I noticed this particularly:
I had been on the big chainring all day but only the top couple of the cassette.
Assuming an ordinary 700c road bike with a 53/39 double, and that you don't mean you were cross-chaining all day, you'd be doing almost 29 mph at a 90 cadence in a 53/13. I don't see where you mention how many hours you were on the road, but I don't think you'd be posting here if that were the case. Therefore I assume that you were turning more like a 50-60 cadence. This is very common for short distance riders who have not yet been beaten about the head and shoulders about maintaining a high cadence when riding long distances.
The problem is that a low cadence is a real glycogen-eater. One's breathing is slow and even, but it's taking it out of the legs. Bonking is just using up one's glycogen, then the blood sugar is next. What you did is not necessarily ill-advised. One summer long ago, I did a solo Imperial century on one candy bar, one orange, and two bottles of water. The record for riding without either eating or drinking is around 270 miles. However, such things take particular training to lower glycogen consumption. Meanwhile, as Machka advises, eat more. But also try riding much, much lower gears, that is if my assumptions about what you said are correct. Try for a 90 cadence on the flat, and 80 when climbing until you run out of gears. If you don't have a computer with cadence, but do have speed, you can get your cadence from this calculator:
http://www.machars.net/bikecalc.htm
just to give you a general idea.
All that said, some very talented people do ride low cadences for long distances, but they are rare.