A Wisconsin mining company and a Pennsylvania software firm were named the best small and mid-sized companies to work for in the United States, according to a survey released Monday.

Badger Mining Corp. of Berlin, Wisconsin, offers generous profit-sharing and health-care coverage, while Analytical Graphics Inc. of Exton, Pennsylvania, excelled for its communication with employees, according to the list released by the Society for Human Resource Management and compiled by the San-Francisco-based Great Place to Work Institute.

"If you have happy employees, you have productive employees," said Frank Scanlan, spokesman for the Alexandria, Virginia-based society.

"If you work to respect them, if you listen to their opinions, you're going to have employees who are engaged in the success of the organization and want to see it succeed."

More than 500 companies applied to be considered for the third annual list of 50 companies, and 271 were finalists, he said. Using information provided by workers and employers, the winners were chosen on the basis of such factors as employee trust, morale, communication, compensation and benefits.

Some companies offer scholarships for employees' children and grandchildren, buy beer for softball games, send out daily inspirational e-mails, host on-site child care or allow unlimited bereavement leave.

At family-owned Badger, which produces industrial sand, employees can participate in an arrangement under which the company shares up to 20 percent of net profits. Executives visit plant sites several times a month to talk with employees, and training accounts for 10 percent of the budget.

Second among small companies, with 50 to 250 employees, was the Pacific Service Credit Union in Walnut Creek, California, followed by recruitment outsourcing firm The RightThing Inc. in Findlay, Ohio.

AGI, located near Philadelphia, previously ranked as the top small company in the last two annual surveys.

A maker of software for aerospace industries, it holds annual review meetings for employees, quarterly town hall meetings and weekly meetings for departments to share information. It provides an on-site gym and free meals for employees.

Second among medium-sized companies, with 251 to 999 employees, was Holder Construction Company in Atlanta, followed by Ultimate Software in Weston, Florida.

"This list gives us a concrete example to point to and say, 'This is why it works, this is how it works,"' said Scanlan. "There's no one path to do it ... but it doesn't have to be hugely expensive to get engaged employees."