Vegetarian for 21+ years, here's how it's done:
Make sure you get some fat in your diet, since your body needs it. Timing on this doesn't matter so much.
If you're already at the weight you want, get some carbs before riding, since they give you energy, otherwise avoid them.
Protein after every ride. If you're trying to build muscle, then shoot for x grams a day total, where x is the number of pounds you weigh. Otherwise 50-80 grams a day to maintain what you've got.
Tofu is great for a fast meal. Open and drain the package, chop it up, put some soy sauce and olive oil on it, and eat.
If you're not a vegan, cheese is your friend. Soy milk is too, but not cow milk. Always get wheat instead of white. Read labels.