I do this all the time with my t-mobile myTouch (Android OS is the shit!). The simplest way to do this would be with a specialized app. Most such apps will have to be downloaded form 3rd party sources instead of default app stores as most of them are violate your terms of service. I'd recomend checking out something called PDANet as they have ports for Android OS, Iphone and black berry. An awesome Android exclusive app is: http://code.google.com/p/android-wifi-tether/
If you wan't to do it the hardcore way though (I'm not sure if this will work with iphone or blackberry but it works fine on my android) is you can actually root your phone (i guess for the iphone this would be the same as "jailbraking it"), connect your phone and computer via a wifi link (ad-hoc or infrastructure doesn't matter) and use ssh to tunnel traffic through your phone via a SOCKS proxy on your computer.
"If art interprets our dreams, the computer executes them in the guise of programs!" - SICP
“If at first, the idea is not absurd, then there is no hope for it” - Albert Einstein