"The only person whose ratings fell more than mine last year is here tonight. Great to see you, Jay," he said to the late-night host, who also headlined the evening.
Obama told the 3,000-person audience he was glad to appear before Leno because "we've all seen what happens when you take the time slot after Leno."
Playing off his vice president's lack of restraint, he joked that Biden had told him the annual dinner was "a big f---ing meal."
Obama noted that McCain has not identified himself as a maverick this year, as he did during his run for presidency.
"And we all know what happens in Arizona when you don't have an ID. ... Adios, amigos," Obama said, referring to the new immigration law in McCain's home state that makes it a crime to be in the state without valid immigrant papers, and allows police to question people they suspect may be illegal immigrants.
VIDEO: Obama pokes fun at McCain's maverick claim
Amongst the slew of celebrities present at the annual event that Obama took aim at were teen heartthrobs, the Jonas Brothers.
"[My daughters] Sasha and Malia are huge fans. But boys, don't get any ideas. Two words: predator drones."