Volunteer work by itself isn't going to get you a residency, but volunteer work and other leadership/extracurricular things can make a difference. I did a lot of extracurriculars during med school, and at least @certain IM programs this was something that was brought up in interviews, and mentioned @ at least one place as a reason they were interested in me (PD called me back and stated they were impressed with my leadership activities, and were going to rank me high, etc.). I agree that USMLE scores tend to hold more weight, though, and that extracurriculars are more something that might differentiate two academically similar looking candidates.
I do think that certain residencies like peds, fp and IM tend to care more about extracurriculars (at least things like clinic volunteering, etc.) vs. some of the specialty residencies. It kind of makes sense, especially as those doing peds, IM or fp will be doing lots of direct patient care, and perhaps working with underserved populations in their resident clinics and perhaps later in their careers as well (depending on the practice setting).