A brand new, Intel iMac will be able to join any WiFi network should you enable the AirPort card (Apple's WiFi card) to do so. You should not need to buy anything for that. As for the USB adapter, if it is not specifically geared towards the Mac, it may not work.
Now if this is a used Mac, you will need to tell us what model it is. We need to know what type of iMac this is. There are iMac G3s, G4s, G5s, and then the Intel models. Take a look at this. Which one is it? List the specifications and what operating system you are using as well. Click on "About This Mac" on the Apple logo (at the top-left of the screen) to check that. For more details, you can click on "More Info" and System Profiler will open with all of your system's specs listed inside. If it is an older iMac, it may not necessarily have an AirPort card. The later iMac G4s and their successors all use the current AirPort Extreme card, which retails for $50 at the Apple Store. Before that, you had to use a regular AirPort card which uses 802.11b instead of the faster options of "g" or "n". To find one of these slower cards, check eBay or other online retailers.
Let us know how you get on.
I have a wireless network set-up using windows XP and a netgear wireless router. I just bought my daughter an iMac and want to add it to my wireless network. What else do I need to buy? I have a netgear USB adapter, but it seems to only have OC drivers.