If you are running IOS 4.3.x then it is in the Settings app. Just go to Settings > General and the option is right there on the screen titled "Use Side Switch to:"
If you don't have that option then look into "RingerSwitchTool" or "Sidewinder", but I have NO KNOWLEDGE if either of these work as advertised...
Hope that helps.