A collection of old barns, log cabins, grist mills and a freight depot have been transformed into a 20th century retail center aimed at attracting local shoppers and tourists to the heart of historic Leesburg.

The $5 million Market Station complex, set in a 19th century atmosphere, opened yesterday.

Some of the center's buildings were dismantled and hauled from West Virginia and Pennsylvania to Loudoun County, where they were reassembled. The project includes a mill and a train depot that were part of Leesburg at the turn of the century.

Market Station's promoters are calling it "Leesburg's answer to Baltimore's Inner Harbor," a popular tourist attraction along that city's waterfront.

The 50,000-square-foot development nearly "doubles the number of businesses in the historic area of downtown Leesburg," according to marketing director Barbara Fitzpatrick. The complex is expected to generate at least 200 new jobs.

The project is a joint venture involving the Town of Leesburg and developers Bruce M. Brownell, president of Brownell Construction Co. of Leesburg, and Beckham W. Dickerson, vice president of KDA, a Reston architectural firm.

Sixty shops, with such merchandise as homemade cookies, cinnamon buns, country crafts, all types of clothing, pet supplies and antiques, occupy spaces in the multilevel complex, which was created by joining the old structures together. Windows have been added to some of the nooks and crannies of the old structures to provide more light and to modernize them.

Brownell said Market Station "is in a gray area between a shopping mall and a conventional shopping center," a claim supported by commercial leasing agents.

"We started out as an entertainment destination but that has changed," Brownell said. "It seems that in the transition we have become an 'eat-a-thon' center." Eight food service establishments are part of the project, including a crab house, a barbecue restaurant and an ice cream parlor.

Dickerson and Brownell said they view the project as enhancing downtown Leesburg, long a goal of local officials and residents. Thus far, however, Dickerson said no tenants have moved from the old downtown to the new project.

Both developers said they believe tourists will visit their project and Leesburg's other attractions, including well-known existing restaurants and antique shops.

Brownell said construction crews are completing the project almost a year ahead of schedule. Seven-day-a-week work started in 1984, he said.

But Brownell said he would not be able to transform the collection of historic buildings into an economically viable shopping and entertainment center if he were starting the project today.

"Without the investment tax credits" that are threatened under the Reagan administration's tax-revision plan, Brownell said he and Dickerson could not have afforded to do the project.

Market Station was originally started as part of a Community Development Block Grant from the Department of Housing and Urban Development. Leesburg put about $80,000 into the project.

One of the goals was to rejuvenate the Harrison and Church Street areas, where the old mill and what remains of the Norman-Harding Barn stood, and bring new housing into the area.

Today, 14 new town houses, all sold to Leesburg residents making less than $40,000 a year, stand about a block from the new commercial center. The land between the town houses and Market Station is used for parking, and there is space for expansion of the shopping complex.

"We have two more city blocks" for further development, Dickerson said.

Brownell and Dickerson searched the countryside in several states for materials and buildings that could be incorporated into the project. In a West Virginia field, they found parts of an old staircase that now create a dramatic passage leading from one of the highest peaks in the complex to another level. Interior walls in offices above the shops are bare, revealing the original wood that was in place when what is now a modern office was part of a grain bin.

Dickerson and Brownell said there were numerous times when the paper plans did not materialize when it came time to physically join the old structures.

Nonetheless, Dickerson said, "It turned out better than we expected."

Market Station is more than 90 percent leased. "We never even got the promotional campaign off the ground," Dickerson said. He is now looking for tenants for the few remaining stores. He said he needs specialty shops carrying more clothing and shoes.

The interiors of the old buildings have been restored, updated and brightly painted. They stand on land that a century ago was the center for commercial activity for those living around Leesburg.

The restored buildings include:

:McKimmey's Mill. Built in 1890, the mill was moved just 300 feet in the reconstruction process. It still contains huge wheels that were used to grind grain brought in by local farmers. Until a few weeks before construction of Market Station began, the building was used as McKimmey's Feed Store, which has now moved to a new location.

*Norman-Harding Barn. Also built in 1890, the barn, also known as The Wharf Barn, remains on its original site. It once was a warehouse in the heart of Leesburg's railroad district.

*Osterburg Mill. The mill dates back to the early 1800s and was moved to Leesbvurg from Osterburg, a small village in southwestern Pennsylvania. The developers said it is a good example of the mills that once lined streams and railroad lines in the mid-Atlantic region.

*Station Master's House. This building was home to the train station master when it was built in 1915. It was moved two blocks from its original site to the Market Station area.

*The Depot. A turn-of-the-century building developers call "a fine example of railroad station architecture." It is now a delicatessen.

*The Log House. Built in 1840 near Rectorstown, Md., the house was made of American chestnut wood. It was occupied until 1978 when it was dismantled, its logs numbered to facilitate reconstruction, and stored in Frederick.

*The Dairy Barn. Built in the Shenandoah Valley near Edinburg in 1900, the structure is typical of the "bank" barns built into the tops of hillsides throughout Virginia with their lower levels left open on the back side for storing grain and food.