Montgomery County officials and a pair of developers are putting the final touches on an agreement that will fulfill a four-year-old county plan to build 48 town houses for moderate-income families at the Potomac Horse Center near Gaithersburg.

Potomac Meadows Corp., a development venture of Geier, Brown, Renfro Architects of Washington, and Architekton of Cambridge, Mass., is expected to sign an agreement with the county in about a week.

Montgomery, which bought the farm in 1980 to use as a horse center and recreation facility for the western county, plans to sell off a southeast pasture for the housing, said Eric Larsen, a county housing official.

The affluent county has had a problem attracting developers of mid-priced housing because land costs there are high. As of this fall, the average price of all houses sold in the county had reached $118,000, according to the Rufus S. Lusk & Son Inc. real estate information service. The median household income in the county in 1980 was $28,987.

In the mid-1970s the county began a program to encourage developers to include lower-priced units in their projects. Builders were offered incentives, such as zoning that would allow them to build more units on their property.

The 49-acre Gaithersburg farm -- now the largest of the three county-owned stables for public riding and horse boarding -- was purchased for $1.1 million, with an eye toward setting aside 7 1/2 acres for middle-income housing.

The county had planned to lease the land to the developers, so that homeowners eventually could buy their own lots. But it was decided it would be less costly for the home buyers if the county sold the land and then retained the right to set resale prices, Larsen said.

It has not yet been decided how prospective owners for the houses will be chosen, although Larsen said a lottery may be held for those whose incomes qualify them for the housing.

The county intends to sell the pasture for a token price that has not yet been decided; the developers will sell the two- and three-bedroom houses for $57,500 and $62,600. As another part of agreement that is being negotiated, the county will dictate resale prices of the houses for the next two to three decades, Larsen said.

"According to the legislation that enabled the county to buy the horse center, we were supposed to sell moderate-priced housing on part of the property," Larsen said. "We could've charged more for the land, but then that would have just added to the price of the unit."

The two architectural firms, now incorporating under the name of Potomac Meadows, were chosen in a design contest two years ago. They were required to include solar devices and retain as much of the property's foliage as possible.

William Geier, a partner in the Washington architectural firm, said that the low price of the land will help the firms to make money on the otherwise low-profit houses.

"In a typical development, land acquisition is a big cost," Geier said. "Everybody's interested in a profit, and we're showing there's enough of a profit that it's worth doing."

He would not say what the firms would make on the project, but said that the profit would be "significantly lower" than the 15 percent to 20 percent standard for most housing developments.

The development of the farmland coincides with plans by the county to have the horse center placed under new management. The center had been operated by the original owner of the farm, Frederick Harting, until his death last summer. Harting leased the property from the county for $32,500 a year.

Bob Young, associate director of the Maryland-National Capital Park and Planning Commission, which operates the center, said that the county is looking for an operator who will encourage public use of the facility, which was criticized by some as a recreation center for the elite at the time it was bought. It is located in the Travilah area where, four years ago, the average sale price of a house was $300,000.

The county has added a number of training classes and clinics for the public, Young said. When the horse center was privately owned, it was used by students and by horse owners who boarded their animals there. Young said that, although business had fallen off for several years, interest in horse-riding has picked up.

The county anticipates that the center will bring gross revenues from students and boarders of $463,000 this year, up $60,000 from last year.

"We realize we haven't reached the potential for use of this center," Young said. "We've had a chore getting the public to use it."