Stage 1 : USB Drivers
1) Download the latest HTC Sync. This will make sure you have the latest USB Drivers.
Stage 2 : The GoldCard
This is needed to make your device allow non-standard ROM's to be installed on it.
Taken from: TheUnlockr.com
2) Your best off using a separate 2gig or 1gig MicroSD if you can. This can then be used any time your flashing a ROM, without worrying about losing data on your main MicroSD card. Put the chosen memory card into your phone.
3) With the memory card in your phone, click on Settings, SD and Phone storage, then click Unmount SD card. Once it unmounts, click Format SD card. (Please keep in mind that some memory cards don’t work, and this will erase all data on your SD Card so back all the data up first to your computer)
4) On the Phone, goto Settings, Applications, Development and then make sure USB Debugging is checked.
5) Plug the phone into the computer and then open the Command Prompt (goto the start menu and type in cmd in the search box). Then type the following with hitting enter at the end of each line.
cd\
cd\AndroidSDK\tools\
adb devices
(wait for it to show a serial number underneath, if it doesn’t then reinstall the drivers from section I).
Then type:
adb shell
cat /sys/class/mmc_host/mmc1/mmc1:*/cid
6) A code will display, write the code down (MAKE SURE TO WRITE IT DOWN EXACTLY!)
7) Goto this site,
http://hexrev.soaa.me/, (thanks to Soaa for the reverser!) then put in your code you just wrote down into the text box and click submit. It will generate the code reversed and replace the first two digits with zeros automatically. Write that down and continue.

Now, on your computer, goto
http://revskills.de/pages/goldcard.html and enter your email in the appropriate field and for CID enter the reversed CID you just copied down (check the first two digits are zero's) *Thanks to Viper for providing these Goldcards for FREE!
9) Click continue and then you will receive your goldcard.img via email. Once it arrives save it to your computer.
10) Now, goto
http://download.cnet.com/HxD-Hex-Edi...=uo&tag=button to download the HxD Hex Editor. Save it and install it to your computer.
11) Take your SD card out of your phone and put it into the SD adapter it came with. Then put that into your computer so it shows up on your computer as Removable Disk.
12) Open the Hex Editor (Run as Administrator if one Vista or Windows 7) and click on the Extra tab, then click on Open Disk. Under Physical Disk select Removable Disk (your SD card you just put into the computer). Make sure to UNcheck “Open as ReadOnly”. Click OK.
13) Goto the Extra tab again and click Open Disk Image. Open up the goldcard.img that you saved from your email. You should now have two tabs, one is the SD card (Removable Disk) and the other is the goldcard.img
Press OK when prompted for Sector Size 512 (Hard Disks/Floppy Disks).
14) Click on the Goldcard.img tab and click on the Edit tab and click Select All. Then click on the Edit tab again and click Copy.
15) Click on the Removable Disk tab (Your SD Card) and select offset 00000000 to 00000170 then click on the Edit tab and click Paste Write.
16) Click on File then click Save.
17) Close the Hex Editor.
18) To test it, take out the memory card from the computer, then put it back in. Try to open the memory card on the computer, if it lets you, you are all set. If it asks/tells you to reformat the card, then try steps 13 – 19 again. If it gives you the same error again, then try a different memory card (Erlern said it didn’t work for him until he finally went and bought a Kingston 2GB card, then it worked on that card).
Stage 3 : The Rooting
19) Download the following files and save them on a USB Drive (FAT formatted)
testruu.exe – DOWNLOAD
pushfiles_windows.zip – DOWNLOAD - MIRROR
rootedupdate.zip – DOWNLOAD
20) Copy/move the rootedupdate.zip file into the root of your GoldCard and place it back in the device.
21) Turn OFF your Desire and turn it back ON while holding the back button. You will see FASTBOOT on the screen in a red box.
22) Now, connect the device to your Windows PC and run textruu.exe.
23) Once the update is completed you will come to a configuration wizard. Turn Off your device.
24) You should have a turned off device. Now, unplug the device from your computer.
25) Unplug the device from your computer and turn your device ON while holding down the volume down button (You will come to a similar looking screen but this time it will say, HBOOT instead of FASTBOOT)
26) Use the volume buttons to move up and down and power button to select the RECOVERY option. (Once you select the Recovery Option, you will see a red triangle on the screen)
27) Unzip pushfiles_windows.zip to your PC and run 'recovery-windows.bat'.
28) Once you run it you will notice, the screen of your device change to a green text on black background recovery image menu.
29) In the recovery image, Select Wipe Data/Factory Reset using the optical trackball
30) Now, from the same menu, select Flash ZIP from SDCard and choose the rooted update. Confirm with the optical trackball. (This process will take a while. So, just sit and relax.)
31) Once the flash process is done, reboot you device.
Once again, I have merely copied/pasted and tweaked a little, information from a variety of sites. I hope they don't mind...
Credits:
MoDaCo.com
sparklehedgehog on XDA Devs
TheUnlockr
Machackpc.com