In the process of home buying, a buyer broker represents the buyer and not the seller. Many people don't realize that traditional real estate agents are working for the seller of a property. Yes, they're working with you, perhaps spending many days showing you dozens of homes. But they're devoted more to the interests of the seller than to your interests. The simple reason for this is economics -- their pay (commission) for completing the sale is a percentage of the actual selling price they extract from your pockets. Therefore, it's to their advantage to sell the house at a higher rather than a lower price.
Also, since the traditional agent represents the seller, if you were to mention to an agent as he showed you a lovely domicile that you'll offer $130,000 and will pay no more than $140,000, don't be surprised if that information gets to the seller. (Of course, there are indeed plenty of agents who'll knock themselves out for you and get you a great house at a good price. Just understand how the industry is set up and what you may be up against.)
All that said, one way to circumvent dealing with agents who pledge allegiance to the seller is to work with a "buyer broker." It's becoming more and more common for people to use the services of a buyer broker. With a buyer broker, you agree from the outset on what his or her fee will be (some restrictions may apply, depending on the state). It will usually come out of the proceeds from the sale, so you won't have to actually cough anything up to cover it. There's still an incentive for the broker to favor a higher sale price, but there are ways to work around that.
When negotiating a fee, start with the amount you expect to pay for your home. Then apply half the standard agent commission in your state to it. For example, if you're looking to pay $150,000 and the standard commission is 6%, then you might offer 3%, or $4,500. To ensure that the agent will work to get you the lowest price, offer to pay him $100 extra for each $1,000 he saves you under $150,000. In other words, if the selling price ends up being $147,000, you'd pay $300 extra to the broker. Fees are negotiable. If you don't negotiate a fixed price, you can very possibly negotiate a lower percentage commission. Remember that these brokers want your business, and you can always take it elsewhere.
Finally, make sure you're familiar with exactly what you're spelling out in the contract. Understand the terms. Are you expected to pay anything if a satisfactory purchase doesn't happen? Are there any hidden fees or expenses? Have you agreed to mow the agent's lawn for a year or pay for his daughter's braces if a deal doesn't go through?