I realize this thread is old, but I'll share my experience:
I compete in major marathon races (4+ hours) and finish in the top 30% (at worst).
For 4-5 hours of trail riding (not racing) I usually pack a banana, and apple, and 1/2 of a peanut butter and honey sandwich. I eat every hour(ish). Usually the banana first (to help block lactic acid build up late in the ride), the sandwich in the middle (protein and some slow - peanut butter, and quick - honey, energy). I eat the apple at the end (last 30-45 minutes) for quick energy, plus they're wet.
Your body can't really process a large amount of calories during a ride that short, and certainly not from complex food sources. I try to keep my food sources natural, so as to not end up with gastric distress of some sort (which will kill your body's ability to output).
For racing, I wouldn't eat anything other than a banana or two during a 4-5 hour race. Most food (non-fruit) is going to take 4-6 hours for it to really be usable by your body, and the chance of gastric distress isn't worth it. In the second half of a race, I'll probably kill a energy gel of some sort every 30 minutes or so.
I always try to eat something sensible (and in a reasonable, non-oversize portion) about 2-2.5 hours before I go for a big ride.
The MOST IMPORTANT thing for prolonged riding is hydration. Going hypoglycemic is not nearly as easy to do as making yourself dehydrated. Once your cells are dehydrated, they don't function at 100% regardless of how much fuel is available to burn. If you ride for a long time, you will become dehydrated. Keep hydrated all the time, and pay a lot of attention to your water intake for the several days preceding a long ride.
I'm sure there is a PHD that will give you a better answer (or 2 PHDs that will give you 2 similar, but not totally in agreement, answers), but I try to keep it pretty simple without trying to become a PHD myself.
Drink water (I use the skratch labs hydration mix.), eat food your grandma recognizes (I'm not suggesting Ensure!), and go have some fun!