David Alaba, Mario Mandzukic and Arjen Robben scored for the Germans who served notice of their intent with a dominant performance on a night when they could have scored more.
Alaba fired the opener from a third minute free-kick and Mandzukic came close twice before making it 2-0 four minutes from the break with a header from Arjen Robben's cross.
Robben made the game safe in the 68th minute when he scored Bayern's third with a superb volley from an Alaba lay-off.
City struggled to get going but opened the scoring through Edin Dzeko three minutes after the break and Yaya Toure lashed home a stunning second in the 53rd minute. Sergio Aguero's neat shot on the turn sealed City's comfortable win five minutes later.
Isco hit Real's 33rd minute opener against the run of play but his goal sparked the visitors into life as they added two more from Karim Benzema and Ronaldo's first of the night.
Ronaldo netted his second in the 66th minute from a free-kick taken by Gareth Bale who had arrived as a substitute moments earlier, Benzema made it 5-0 on 81 minutes, and after Umut Bulut had grabbed a late consolation Ronaldo completed his hat-trick in injury time.
Rooney volleyed United's opener on 22 minutes but the home side were shocked by Simon Rolfe's equaliser for the Germans with a deflected shot nine minutes into the second half.
Robin Van Persie put United back in front with an acrobatic effort before Rooney netted his 200th United goal from a long clearance by David De Gea on 70 minutes.
Antonio Valencia made it 4-1 before Omer Toprak scored a late consolation for the visitors.
Vladimir Weiss hit the woodwork twice for the home side in the early stages before Edinson Cavani gave the visitors a 19th minute lead against the run of play.
Weiss grabbed a richly deserved equaliser six minutes later but Thiago Motta restored the Ligue 1 side's lead with a 68th minute header. Thiago's second five minutes later sealed the win and Marquinhos scored a fourth for the visitors four minutes from time.