Here's a different sort of explanation for the phenomena: Stimulants activate the "flight or fight" systems in many people; that's why we say they're bad for anxiety. But I have hardly any "fight or flight" response in me at all; while many anxiety-disordered people have abnormally high arousal levels, mine are very abnormally low. My anxiety is actually monotropic vulnerability; it's a matter of putting my eggs in one basket (and often a flimsy basket at that). So... if a substance like coffee can stimulate enough interest/ arousal that I focus outward on things other than my own particular obsessions, well, the overall effect is going to be calming.
People who've known me over the years know I have this thing about coffee -- and that I did long before I had any explanation whatsoever for the fondness!
Coffee Picture: Gregory Szarkiwicz, Free Digital Photos