I was having the same problem with my Trek 520 especially on the middle ring too. I had my LBS adjust the rear dérailleur and it fixed the problem for a while. It started happening again and I was about ready to take the bike in again. The bike is only 4 months old too.

I think I figured out my problem though...... I commute to work and ride 9 miles in really dusty conditions on an old railroad bed. My drivetrain was getting pretty dirty within just a few days time. I can even see a thin layer of dust on the bike when I get home.

Whenever my shifting starts getting rough, I started just giving the bike and especially drivetrain a thourough cleaning and re-lube and the problem ( for me ) goes away. I actually just ordered myself a set of full-fenders so, hopefully it will help protect my drivetrain from road dirt and grime. I think I need a better chain lube too. My LBS used White Lightning... Self cleaning wax lube.