The American made her opponent work hard for the victory, with the 15th seed needing almost two hours on court to secure her place in the third round.
The Frenchwoman made five double faults in the first set, helping McHale bring up 10 break points, but she was able to clinch only one of her opponent's service games.
Meanwhile, Bartoli battled while receiving, regularly coming into the net to break McHale twice, claiming the first set 7-5.
Bartoli's serve improved in the second, but the young American was still able to secure a break as she pushed hard from the back of the court.
The 15th seed continued to come in from the baseline as she attacked McHale's serve, managing to get the break back, before securing another to edge ahead in the set and eventually serve out the match.
Bartoli faces Italy's Camila Giorgi in the next round.