Ann and I often hear from writers who've unwisely signed with a scammer or an incompetent, and want to know how to get out of the relationship. In many cases, I don't think that it'd be a big deal simply to walk away. Since the contract was offered under false pretenses (that the agent was capable of selling your manuscript), you could argue that it was never binding. Still, for caution's sake, it makes sense to formalize things.
(Obligatory disclaimer: nothing in this post should be construed as legal advice. I'm not a lawyer. What I'm offering here is a series of general suggestions based on experience and research.)
First, check the contract to see if there's a termination clause. If so, invoke it per the instructions in the contract. Once whatever notification period the contract requires is finished, you're free.
If there's no termination clause (and for future reference, NEVER, EVER sign an author-agent contract that doesn't allow you to terminate at will with adequate notice), send a registered letter (return receipt requested) to the agent's last known snail mail address (if the agent has an e-mail address, send an e-mail as well). State that you're terminating the contract as of 30 days from the date of the letter, and instruct the agent to immediately cease all efforts on your behalf, including but not limited to submissions to publishers. Keep a copy. Even if you don't get a response, this should be sufficient in most cases.
You're not done yet. Read your contract carefully to see what rights, if any, the agent claims after termination--such as a commission on any publishing deal the agent initiated or was negotiating at the time of termination, even if the contract is signed after termination. This isn't really something you need to worry about with a scam or incompetent agent--still, if it's in your contract, you need to be aware of it, just in case. Also, any agent will continue to receive commissions on a contract she brokered, for as long as the contract is in force (again, not really an issue with a bad agent, but something to remember for the reputable agent you wind up with the next time around).
You also need to find out exactly where your manuscript has gone. A new agent will want to know, because you can't usually resubmit a ms. to a publisher or imprint that has already rejected it, and your new agent won't want to replicate others' efforts (unfortunately, if another agent's submissions have tapped out the market for your work, a new agent may find you less attractive as a client--this is the real disservice that marginal agents do their clients, but that's a matter for another post). Be prepared for resistance. Questionable agents often clam up when you ask leading questions of this sort, since the answers don't reflect well on them.
There are also some circumstances in which you don't need to know where your ms. has gone. If you've wound up with a scammer (as opposed to someone who's just incompetent or marginal) the odds are high that IF your submission was sent out (scammers often don't bother to submit), and IF the address was correct (scammers who do submit often get this kind of stuff wrong), no one looked at it because a) the publisher was totally inappropriate, or b) the people at the publisher were familiar with your agent, and not in a good way. (Writer Beware may be able to help you determine what level of scammer your agent is.)
And now for something completely different...
One of the great things about blogging is the chance to get interactive with readers. So ask us questions! Do you want to know if an agent's business practices are kosher? Are you concerned that a publisher isn't legit? Have you run into something that makes you uneasy? Are you unsure about some aspect of querying and submitting? Post questions in the comments section of this or any of our posts, and we'll answer them here.