You should be more specific as to what you are trying to rotate.
To rotate a game with a command line version of mame, just launch the game with -rol or -ror. (Or change the setting in mame.ini).
For Mame32 you can change the setting in the menu (it is under video I believe).
Now for a rotated frontend. You can go the hard route (pivot software and Mame32, or any newer nvidia drivers if you have an nvidia card), or you can use a frontend that supports rotation. A lot of them do, I am personally using advancemenu on one vertical cabinet and game launcher on another. (Be sure and download that second configuration utility listed on the gamelauncher site). If you are using dos, then arcadeos rotates too, I used to use that.