I'm not sure there's a right answer to that question, since it involves slightly different strategies.
Maprilynne's strategy (agents first, houses open to unrepresented submissions second) is one approach, and a very sound one.
On the other hand, a sale in hand--or even having an editor reading--can often be a good way to get a top-class agent.
Both approaches have risks, both have potential rewards.
When I got my first offers of representation from agents, a senior editor at Random House was reading a partial. I think that I would have gotten an agent in any case, but being able to mention that an editor at a big house was reading certainly didn't hurt my query letters...
...but saying "My book has already been turned down by an editor at Random House," doesn't have quite the same effect!
("But isn't Random House closed to unsolicited submissions?" Yes. But I met the editor at a conference, she liked my book's premise, she read the opening pages and liked them, and she asked for me to send her the opening chapers. Once she asked, it wasn't unsolicited.)
I wouldn't query the small presses until I was well down my list of agents. But if an interesting opportunity cropped up, I wouldn't ignore it just because I wasn't done with querying agents.
There. Does that suitably confuse things?