Go into "Settings"
Scroll down to "Accessibility"
Scroll down to "AssistiveTouch"
Turn on "AssistiveTouch"
A circle will appear on screen (sorry for the missing image, it disappears when you take a screen shot)
Now you can control your iOS device without any physical buttons
Some of the other options available under "Device"
Keep in mind you still need physical buttons to unlock the device but other than that, everything can be done on screen. Also, some apps (mostly games) hide the AssistiveTouch button but that's rare.
- iOS device with iOS 5 or higher