I've heard numerous anecdotal claims of people being rescued from shark attacks by dolphins. One source mentions that such rescues happen "surprisingly often", and cites three unreferenced incidents, including one where a pod of dolphins supposedly fended off a 10-foot great white shark.
Yet this site references a program in the 1960's by the U.S. Navy that trained Bottlenose Dolphins to incapacitate large sharks. The program appears to have been a qualified success: the dolphins would readily attack sharks not known to attack dolphins in the wild, but they refused to approach Bull Sharks (which are known to attack dolphins in the wild). That site summarizes with this:
In the wild, similar-sized dolphins and sharks pretty much leave each other alone. Some 75% of wild dolphins show some degree of shark scarring — and we usually see only the ones that got away. I have pulled dolphin remains from the stomachs of many sharks over the years, particularly from Tiger Sharks (Galeocerdo cuvier). Thus, it seems that in most battles between dolphins and sharks in the wild, dolphins get the worst of the encounter.
This seemingly contradictory information makes me question whether dolphins really risk confronting large, aggressive, dolphin-eating sharks to protect random humans, anecdotal data aside.
Is there more concrete information about dolphin-human-shark interaction?
Edit: In light of a comment in ChrisW's answer, I would also be interested in any studies confirming that dolphins attack large, aggressive, dolphin-eating sharks in the absence of distressed humans.