It starts with hours of research. Which, as long as you’re a writer, you’re probably good at anyway. So, that’s a breeze. My go to website is http://agentquery.com/default.aspx . Most agencies have websites now, and you can find links to them directly from this site. Agents generally prefer your submissions by email, and a growing number will not accept snail mail queries at all. Find out which agents enjoy the same literary leanings as you, and then find out their submission requirements.
Query letters are clearly the work of the devil. They may be evil, but they are the necessary kind. They are your literary foot in the door. Stop by Publix and purchase a large supply of your favorite chocolate, or whatever happens to be your personal stress reliever, then research some more. This time focus on how to write the perfect a query letter. This one page summary of what you and your novel are about is almost as important as the manuscript itself. Do not ever take this lightly, and never send it without sleeping on it and revising, sleeping, revising.
This is a great list of some Do’s and Don’s to get started with: http://www.writing.com/main/view_item/item_id/844651-How-to-Write-a-Query-Letter
Pick your query letter apart by word, sentence, paragraph. Make it the best, most persuasive, morsel you’ve ever written. When the agent finishes reading the first paragraph they should be salivating to read your book. Above all make the letter grammatically flawless and give it a reason to shine above the rest. This is the agent’s first taste of your writing. Make it a delicious one!