I'm actually in the process of writing a hub working with agents.
Yes, there are some agents you can trust, but very few. The barriers to entry into the field are so low, practically anyone can be an agent. I am especially mistrustful of buyer's agents because of the inherent conflict of interest. The more you pay, the more they get paid. That being said, because of their access to multiple listing services and their local market knowledge, real estate agents can be very helpful. Here are some of my tips on protecting yourself:
1) Only work with an experienced agent. They are not only more competent, they are less "hungry" and desperate than newer agents. They understand the power of generating referrals by treating people well. They also have more continuing ed under their belt, which is required for license renewals.
2) Check with the state's licensing board to make sure that no complaints were lodged against your agent before you enter into an agreement with them. (It might also be a good idea to look up the agent on the other side of the transaction.) You can also check with the National Association of Realtors. They hold their members to a higher ethical standard than the state does. Most, but not all agents are Realtors.
4) Find an agent who is an expert on your neighborhood. A good agent will target a few micro-markets in which to operate, allowing them to learn all the ins and outs. This kind of focus can make an agent better at determining a property's worth than an appraiser.
5) As mentioned in the previous answer, do your own homework. Learn about your local market, the basics of construction and physical condition, typical repair costs and financing. The more you know, the less an agent will be able to persuade you against your better judgment.
6) Finally, remember that you hired the agent, therefore you drive the process. You decide the price at which you will sell or buy, your financing and how many homes to look at before you buy. Don't be bullied into accepting an offer. Also, remember that you can negotiate the terms of your listing agreement such as commission, length of the listing etc before you sign.