ijailbreak.com had a tutorial last summer for iOS4 where you SSH into the phone to increase the volume output. After iOS5 came out, I tried it but it wasn't the same because Apple moved some files around. Even after locating them, it didn't have the same effect as it did on iOS4.
When I first upgraded to iOS5 I looked around to see if anyone figured out how to increase the volume output but I didn't have any luck. Ilthere were a couple people trying to figure it out. Who knows, maybe they've been successful. I haven't read up on it for at least 6 months now. I'll do some googling to see if I can find anything. I'm curious about this too. Honestly I completely forgotten about this old technique.
If you're interested in seeing how it was done on iOS4, just google ijailbreak and increase volume or something similar. I'm sure you'll find the post. Maybe you can play around with the files yourself and figure out a solution.
Edit: I found the post to save you some time.
http://www.ijailbreak.com/cydia/how-to-significantly-change-the-volume-limit-on-iphone-ipod-touch-ipad-all-firmware-versions/