Tethering using unofficial/home-made carrier bundles (which you would have to use in the case of an unlocked iPhone + a SIM from a cellular provider who doesn't sell the iPhone) is still possible in 3.1.2, but you have to work around some extra...protection measures that Apple put in place with the goal of ensuring that only official carriers who WANT to enable tethering for their users (or at least for users paying for tethering) can actually turn it on.
How you go about doing this depends on what unlock you are using:
If you're using blacksn0w, it automatically works around the tethering block in the software for you, so you don't have to do anything other than install the appropriate carrier profile to your phone for your provider.
If you're using ultrasn0w, it doesn't, so you need to patch up the CommCenter binary to work around the restriction. Here's the easiest way to do that that I've found so far:
In Cydia, search for "iphone-notes" and install the "iPhone-notes.de's Source" repo that shows up in your search results. After that, search for "tethering," scroll to the bottom, and install either "Tethering 3G - 3.1.2" or "Tethering 3GS - 3.1.2," depending on which one is appropriate for your model of phone (3G or 3GS).
MAKE SURE YOU INSTALL THE CORRECT ONE, OTHERWISE YOU WILL CORRUPT A CORE OPERATING SYSTEM FILE AND YOU WILL BE STUCK AT THE "APPLE LOGO OF DEATH" UPON REBOOT, REQUIRING A COMPLETE SOFTWARE RESTORE OF THE PHONE TO RECOVER.
After that is done, you can proceed to install the correct carrier profile to enable the tethering option.
If you have an original iPhone (EDGE-only) model, I believe you are out of luck for the time being. Apple's official stance is that the original iPhone does not support tethering, and even if the code does exist in the original iPhone OS (kind of like with MMS), nobody has found a way to activate it yet (unlike with MMS). If I learn otherwise, I will follow-up. You didn't specify which phone model you have...
As far as the correct T-Mobile U.S. WAP gateway to use, I am afraid I wouldn't know and cannot help you there. Hopefully someone else can step in.
Hope this helps,
-- Nathan