This is what I did on my 3G iPhone JB & Unlocked.
1. Update to 4.0 via iTunes
2. You'll get the message about the unsupported SIM card if you're not on AT&T
3. Exit iTunes
4. Turn off phone but keep it plugged in to the computer
5. Run redsn0w
6. Select 3G 4.0 ipsw (
Download Link)
7. Follow redsn0w application
8. Once complete, unlock with ultrasn0w via Cydia.
If you have any questions, you can message me

. I did this on a Mac, but Windows should be very similar.