Wearing the captain's armband, Lloyd got the first on 69 minutes from a penalty kick with defender O'Hara scoring her first-ever goal for the Americans six minutes from time yesterday.
The United States, winners in 1991 and 1999 and ranked second in the world, will play either defending champions Japan or England in the final at Vancouver on July 5.
Germany's Celia Sasic, the tournament's top scorer with six goals, missed a penalty on 60 minutes that was awarded after Julie Johnston pulled down Alexandra Popp in the box.
And six minutes later, Alex Morgan also missed a chance to break the deadlock when she sent the ball just wide of the German goal.
More From This Section
USA were then awarded a penalty when Morgan was brought down by defender Annike Krahn in the box.
And Lloyd made no mistake, stepping up and sending the ball into the corner of the net for her third goal in as many games as 'keeper Nadine Angerer dived the opposite way.
The USA's all-time leading goalscorer, Abby Wambach, came on 10 minutes from time in place of Megan Rapinoe.
Japan and England play their semi-final in Edmonton on Wednesday.