Satin dresses rustled, diamonds flashed and Marie Osmond sang "God Bless America" Saturday night at a salute to the 40th anniversary of the USO and Bob Hope. It was one of the most expensive, elaborate and lengthy charity dinners ever held here.

For $25,000, the going price for a table of 11, 800 guests got to hear five hours of music from the armed forces' bands and glee clubs, quips from Hope and two GOP presidents, and a nostalgic film capsule of Hope's many years of entertaining for the USO.

It was the president's first extended visit to the Washington Hilton since the assassination attempt there last March. The commander-in-chief, as he is known in these circles, seemed relaxed and got more laughs than Hope.

"I don't think any of us realize that there probably isn't anyone who loves their work as much as Bob Hope," President Reagan began. "I discovered that once when he was up at our ranch and I took him over to the padded fence to show him our horses, and then I got a telephone call.

"When I came back he was doing a monologue for the horses."

Laughter. Pause.

"And they were laughing."

Laughter.

"Seeing all you nice people here tonight makes me realize how nice people can be," the president continued. "I got a letter from the environmentalist the other day." Knowing laughter before the punchline.

"He said it's the first time he's ever been able to make the children behave. He now scares them into being good by saying James Watt will get them.

"Tomorrow Nancy and I are going to Virginia to commemorate the battle of Yorktown. And let me lay to rest one thing. It isn't true that Bob entertained the troops there. He was still at Valley Forge."

Reagan then presented Hope with a surprise citation, naming him the "ambassador of good will for the entire world."

Hope, who was staying at the White House, appeared touched by the award from his old friend. But it didn't stop him from making the president and first lady the brunt of some of his one-liners. A few:

* "Nancy was supposed to have said she couldn't wait to redecorate after the Carters moved out of the White House. All she really said was she couldn't wait to sweep the peanut shells off the floor . . . "

* "The president has had quite a career. He realized the world wasn't ready for two Howard Cosells . . . He became the kind of actor I like, he didn't get any laughs or win any Oscars . . . "

* "The president worked hard as an actor and a governor and now a president. He worked his way up because Nancy had this certain dish pattern that she wanted . . . "

* " . . Now as sports announcer he was a local hero, Mr. Reagan. He told all the kids that they wouldn't grow up to be big and strong if they didn't eat their ketchup."

The crowd was mostly Republican and the contributers mostly corporations, although some members of the Reagan Inner Circle paid for costly tables. Walter and chief of protocol Leonore Annenberg, the Charles Wickses, insurance mogul Clement Stone and lawyer Roy Cohn each laid out $25,000 and invited friends and politicians to eat lobster appetizers and a beef and vegetable dinner.

Among the other guests were former president Gerald Ford, Treasury Secretary Donald Regan, Health and Human Services Secretary Richard Schweicker, Chief Justice Warren Burger, presidential counselor Edwin Meese III, Associate Supreme Court Justice Sandra Day O'Connor, CIA Director William J. Casey, and OAS Secretary-General Alejandro Orfila.

Burger said the new addition to the Court, O'Connor, "is doing just great. The thing I like the best about her is that she's brought down the average age of the court."

Speaker of the House Thomas P. (Tip) O'Neill (D-Mass.) seemed to be the only Democrat in the sea of black ties and uniforms. He was in a good mood, despite having lost two members of his party to the other side last week.

"I'm just amazed that they would switch parties when the polls showed us up 12 percentage points this week," said O'Neill. "Not many people would get aboard a ship that's sinking like this one is at the present time."

Security was tight. The evening's activities were delayed because everyone had to enter the ballroom in a single file and pass through a metal detector. The president and first lady waited in a back room of the Hilton.

When the president was ready to leave, a black limo and Secret Service car waited by the same door the president used last March 30. With several hundred people gathered outside -- in a scene eerily reminiscent of that day -- the real presidential car sped out of the underground garage. The two decoy cars brought up the end of the 11-car motorcade speeding off toward 1600 Pennsylvania Ave.