I'll assume you're asking about the IP side of the equation. For help on the business side of the equation, I'm not sure this is the best place for answers.
Copyright: write the software and it's copyrighted. Put a copyright notice in there, e.g., "Copyright (C) agentjk, 2006. All rights reserved.", and you're even better off. Done.
Trade secret: write the software and don't tell anyone about it unless they sign an NDA (Non-Disclosure Agreement). Done.
Patent: write (or have written) a patent application describing your idea in enough detail to enable one of ordinary skill in the art to make and use your invention and including your contemplated best mode for practicing your invention and distinctly and partiuclarly claim what you believe to be your invention in its broadest, yet still novel and non-obvious, characterization. File the application and push it through the Patent Office to issuance as a US patent. Done.
Now, with the copyright, you'll have the right to stop someone from directly copying your software or making a "derivative work" of your software. You won't have the right to stop independent creation (not copying) that results in exactly the same software.
With trade secret, you'll be able to collect damage for breach of contract against anyone who signs your NDA and then discloses or uses your information without your consent (unless they find the same information elsewhere, including your own published patent application or patent).
With a patent, you can prevent anyone from making, using, selling, or importing anything described by any claim of your patent. Independent creation and learning of it from public sources are not defenses to patent infringement.
As I said in my FAQ, these rights don't enforce themselves and not everybody graciously acquiesces to your rights. Sometimes, you'll have to enlist the government's help in enforcing your rights. Generally, it's best if you carefully abide by the government's rules and assert arguments that are most likely to bring you victory, regardless of whether it sounds best to you. In other words, it's really best to get professional help when enlisting the government's help in enforcing your rights -- hire an attorney.
So, those are the steps you can be taking. There are steps vis-a-vis trademarks as well, but that has more to do with marketing your idea than your idea per se.
Regards.