President Reagan, bearing effusive praise and some surprise federal largess, ventured a few miles uptown last night to proclaim the virtues of his economic program at a fund-raising reception at Howard University.

Reagan was greeted warmly by 350 university benefactors who attended the $1,000-a-person event. But on the outskirts of the main campus quadrangle, which had been sealed off by the Secret Service to all but reception-goers, another 250 faculty and staff members and students chanted protests.

The president and Mrs. Reagan were not within sight or earshot of the demonstrators.

At the reception, Reagan spoke glowingly of the role Howard and other predominantly black colleges had played in "offering hope . . . at a time when education opportunities for blacks were denied elsewhere."

He said the last 15 years have demonstrated that government-inspired programs of economic redistribution, no matter how well intentioned, produce an "ever-shrinking pie" of economic abundance. His economic program, he said, will bring a bigger pie and therefore bigger slices for all citizens.

Shortly after he finished his anti-big-government pitch, the president shifted gears and engaged in the old-time religion of political grantsmanship. He announced that the Urban Mass Transit Authority had just awarded $800,000 in research grants to predominantly black colleges, with two of the 10 grants going to Howard. The two grants are worth $142,000.

Alan Hermesch, director of the university's information office, said afterward that the announcement "came as a complete surprise."

Reagan also surprised Hermesch with an anecdote he told about the first time he became familiar with Howard. He said that during the campus unrest of the late 1960s, he read a survey of student attitudes that showed one campus after another filled with disillusionment and despair.

But at Howard, he recalled, the "overwhelming majority of students expressed pride in our country," a finding that brought "great joy to a lot of us on the shady side of the generation gap."

Hermesch said he was not familiar with the survey. A White House press spokesman said last night that he also was not familiar with it, adding that the president had inserted those remarks in his prepared text on his own.

Outside the locked gates, the protesters milled about in orderly fashion, bearing anti-Reagan placards and sentiments.

"It's important to understand that his coming here is part of his black strategy," said Ronald Walters, a political science professor and head of the university's Faculty for Justice, which organized the protest.

"He also visited a black family in Maryland and a black school in Chicago. But it's symbolism, not substance," Walters said.

Among the demonstrators was Howard professor Haile Gerima, who said that he, like most of those with him, believes that the president's visit was "strategically scheduled" to take place after most people had left campus for the summer.

"I think this visit is the height of hypocrisy," said Sahu Barron, carrying a banner for the People's Anti-War Mobilization Committee. She said she objected to Reagan's appeal to Howard, "a symbol of black pride," at the same time that his policies call for curtailment of student assistance and social welfare programs.

Reagan's appearance added another dollop of glue to a relationship that the White House and Howard have gone out of their way to further in the last year and a half.

In November, Mrs. Reagan toured the university hospital and last spring, Vice President Bush was the main speaker at Howard's commencement.

For the school, the benefits of the close ties are written on the bottom line. With Reagan's support, Howard this year received an 8.4 percent increase in federal funding, to $139.4 million, at a time when the administration was pushing 20 to 25 percent cuts in most education programs.

Even though it is a private institution, Howard uses federal funds to cover three-quarters of its academic expenses. The school, which the government helped to establish in 1867 to educate freed slaves, has always enjoyed substantial federal aid, and in 1980, ranked second in the nation only to Johns Hopkins University in overall federal support.

For Reagan, who pledged during the 1980 campaign to support predominantly black colleges, the relationship is a bulwark against claims that his administration is anti-black.

He has made several other efforts in the last month to counter that perception, but White House sources said last night's event was arranged long ago and was not a part of any concentrated attempt to cut political losses in the black community.

In his only other public appearance yesterday, the president told retail industry leaders that if "we can finally get control of the budget monster, then I believe a strong and lasting recovery is not far away."

"Your industry may be beginning to inch us out of this recession," he said during remarks in the Rose Garden, noting approvingly a 1.4 percent increase in retail sales last month.