The only program I know of that allows tethering and SSH tunneling is itunnel. It is free, open source, and fairly easy to setup and use. The download contains a binary (the program) and the source code. The binary is the file labeled itunnel; if you want to be able to run it from the command line just by typing “itunnel”, move it to /usr/bin or /usr/local/bin. It's simple to use, but unfortunately doesn't always work quite right. Just run it on the command line; the output of the command is important to determine when it successfully connects. You might have to run it two or three times to get a connection and might have to unplug your iPhone and plug it back in; the software isn't perfect. You also might have to run itunnel with root access. However, once it gives you the “successfully got device/server waiting for ssh connection” message, you're in luck! You now have a working connection to the iPhone.
The default port for the tunnel is 3023, but if you run itunnel with a port number as its argument, you can change this. After itunnel connects just SSH to port 3023, and you're in! To enable tethering, use the command “ssh -D someportnumber -p 3023 mobile@127.0.0.1” and type in the password you set for the mobile when you set up the iPhone (the default should be “alpine”) then make Firefox use port someportnumber (which you specified above) as a SOCKS proxy. You also need to set up DNS to work right, by typing about:config in the address bar and setting network.proxy.socks_remote_dns=true (just scroll down to the entry and change it.) Don't forget that you've set this; if you want to use some other proxy later, you'll have to change it back.
There is a more in-depth itunnel tutorial provided by the program's maker. Also, keep in mind that you might also need to install something (probably available from Cydia) to allow your iPhone to bridge the connection properly.