Most cyclist agree that its a good idea to warn someone that you are about to pass them. You yell "on your left" or ring a bell. I like the bell myself. It seems more polite and cheerful, and saves my throat.
Keep in mind I speak as a rider who is commonly passed on the climbs, but does a lot of passing everywhere else. Its the bike.
Skilled racers in higher categories rarely do this amongst themselves, because most racers ride predictably enough that notifying them will not change a thing. Also most racers are not startled by being passed. Most race packs involve constant passing and being passed.
There are however a few riders that you do NOT want to notify. They will either move into your path or turn their shoulders to look at you, causing them to move into your path. Unless you know the rider, it can be hard to tell. But, some riders do not respond well to notification of a pass. Please don't be one of them.
Here is a video of this very thing happening tonight. One ding of a bell and the rider looks behind him, moving 3 feet to his left in the process.
CVC Tuesday Night Rock Store Ride (Also ATOC stage 8), passing etiquette from Jim Verheul on Vimeo.
GoPro HD on flashpoint bar mount, 1280x720p, 60fps, wide angle.