One of the official bonus tools serves this very purpose, specifically, in the bonus tools menu: /Modify/Orient mesh to Edge/Vert tool.
You can check how this works first in this video, by Steven Roselle:
https://www.youtube.com/watch?v=oofVnLDhtNA
The second example shown by M. Roselle, at 2:07, shows exactly what you're trying to achieve. You just can start by doing what keith suggested to "prepare", let's say, your object to rotate (ie:move its pivot, before using the tool).
hope this helps.
btw, the bonus tools is now a simple setup file, downloaded from autodesk, and it now installs without any headaches (no environmental variable or python path to set, as before), for Maya 2015 or 2016, and since there are more than a few very useful gems in there, there's no reason not to install them.