As soon as you write something original, its copyrighted by you automatically.
However, if someone was to try to copy it, you'd have a VERY hard time fighting it in court.
So if you're REALLY worried, you can register the copyright with the government, which basically means the government formally acknolodges and keeps a record of your copyright.
Another option is the take a CD with your software on it, and like a little note saying you mailed it to yourself, sign the letter, and mail it via United States Postal Service TO YOURSELF. Then NEVER OPEN IT. That way, you have a Federal authority ( the postal service ) putting a datestamp on a sealed envelope with your name and info on it. Then if you need to go to court, you just give the judge the sealed envelope. Shows that you made such and such on whatever date. As long as they didn't copyright it before you ( which can't happen cause you made it ) then it proves its yours.