Much of what you need to eat and drink depends on how long you're riding for and at what intensity.
The general rule is that you have around 90 mins of energy as blood sugar. This doesn't just come to a halt, though, as your liver metabolises your energy (including fat) reserves. However, if you're using energy faster than you can get it into blood sugar form, then you're in trouble - this is determined by the intensity of riding.
So, for MTBing, because the rides are rarely longer than 3 or 4 hours, and aren't run at that high an intensity (due to the general faff and looking at the views etc.), I use water only and a banana or cereal bar or two.
On the road, if it's a hard ride longer than an hour (aren't all road rides longer than an hour?), then I use a combination of homemade energy drink (maltodextrine and fructose in a 2:1 mix), energy bars and gels.
I control my calorific intake off the bike by being careful what I eat (though not failing to fuel properly for rides).