Find a local range that has matches every week or so. The best thing to do is go there and talk with the guys that are regulars. They can give you the basics and are usually happy to have a new shooter around. The rule-books can be found in PDF form online, and cover little details that aren't so important on the first time, but on the second, you'll want to be playing fairly so you can see where you stand.
In all of the comps, safety comes first. Always keep the gun pointed down-range, don't trip over your own feet, don't drop the gun, and always keep it unloaded until you're up to bat.
For IDPA, you'll need at least three mags, depending on what type of gun. For USPSA, you'll need a lot of mags.