FA Cup: Yeovil 0 Man United 2
Close-season signing Herrera started for the first time since early December following injury, and he rocketed home a volley to break the deadlock in the FA Cup third round clash at Huish Park after United had laboured through the first period.
With League One's bottom side Yeovil still battling hard, £59 million man Di Maria was then introduced from the bench in an effort to make the game safe, and he weighed in with a trademark chipped finish in injury time to book United's place in round four.
Visiting boss Louis van Gaal entered the game with memories of an embarrassing 4-0 League Cup defeat to MK Dons in August still fresh in the mind.
He made his intentions clear by selecting a strong XI featuring the likes of Wayne Rooney, Herrera, Radamel Falcao and David de Gea but that star-studded XI had minimal impact on an opening half in which United struggled to forge clear-cut openings.
Rooney went closest to scoring during a cagey start, curling a shot narrowly over the crossbar after the ball broke to him 20 yards from goal.
Yeovil, however, looked the more dangerous side as they caused United early problems.
The game was brought to a halt for a lengthy spell in the 20th minute following a clash of heads between Paddy McNair and Kieffer Moore, although both players were able to continue.
United had another chance soon afterwards when Herrera played a ball into James Wilson, only for the striker to hit his shot straight at goalkeeper Jed Steer.
That was one of the few promising first-half moments as slack passing undermined United's efforts.
Van Gaal's obvious displeasure was best summed up by his decision to make two half-time changes, introducing Juan Mata and Jonny Evans as he switched to a 4-4-2 diamond.
That brought an initial improvement as some crisp passing led to Wilson nodding just over from Tyler Blackett's cross.
But United should have been behind in the 55th minute when Moore hit a shot straight at De Gea from six yards after Evans had inadvertently flicked a cross into his path.
Yeovil were rueing that miss when Herrera broke the deadlock in spectacular fashion after 64 minutes.
Darren Fletcher's attempted pass deflected 25 yards from goal and, having turned 180 degrees, the Spaniard unleashed a spectacular first-time volley that left Steer with no chance.
Yeovil came back into the game impressively after Rooney had curled a free-kick over, with Di Maria - also returning from injury off the bench - required to head Joe Edwards' goal-bound header off the line.
But, after Rooney had uncharacteristically fluffed his lines from 12 yards, the Argentine winger's most telling contribution came at the other end as he raced clear on the end of Rooney's throughball and superbly chipped Steer to finish the job.