Costco's (Nasdaq: COST) stock has grown by an annual average rate of 7% over the past five years, even while the S&P 500 lost money. Incredibly, it's achieved that success by doing right by all three of its key constituents: shareholders, customers, and employees. That's a compelling combination.

To do right by shareholders, Costco grows at a manageable rate. It upped its store count by 2% over the past year, and it's planning for as much as 6% store count growth in 2011. Its membership is slowly but surely expanding, with very low turnover and an 88% renewal rate. Its total membership revenue for the year is $1.7 billion, up 42% in four years.

That 88% renewal rate allows the company to keep prices low, holding markups to just 14%, according to consumer advocate Clark Howard. Inexpensive goods help its customers keep their carts and their wallets full, a particular boon in a tough economy. Costco's no less generous toward its employees, whose wages start at $11.50 per hour and reach $19.50 an hour after four and a half years.

In this virtuous circle, happy employees serve customers well, driving business and rewarding shareholders. While this formula may not be the norm in American business, it's hardly unique to Costco.

Formula fitters
Consider the online shoe retailer Zappos, which has gained a reputation for top-notch customer service. It grew so successful that Amazon.com (Nasdaq: AMZN) ultimately bought the company for close to a billion dollars. Amazon itself offers sterling service, a great selection, attractive prices, and gobs of customer reviews. Employees who've posted on glassdoor.com are generally happy with Amazon's stock options, benefits, and work environment. These factors all contribute to the company's stock performance; its shares have risen an average of 32% annually over the past five years.

Similarly, Google (Nasdaq: GOOG) employees love its generous benefits and ample pay. It's also become a staple for its customers, who use it daily for mail, Internet searches, and more. As a result, shares have risen an annual average of 10% over the past five years.

Corporate customers
Even less consumer-centric companies can fit the mold. Storage specialist Brocade (Nasdaq: BRCD) has averaged 12% share-price growth since 2005. It's one of Fortune magazine's 100 best places to work, sporting an amazing job turnover rate of just 3%, and its products and services help boost its customers' efficiency. In a project for Rackspace Hosting (NYSE: RAX), for example, Brocade's equipment increased the company's storage area network capacity, expanded storage and backup scalability, and reduced power consumption by 50%.

Consulting and outsourcing specialist Accenture (NYSE: ACN) is another of Fortune's best employers, with low turnover of 7%. It's served its customers well enough to be named the top outsourcing service provider for three years in a row, delivering business-improving solutions to many well-known companies. At Harley-Davidson (NYSE: HOG), Accenture improved the company's human resource department's capability in workforce planning and enhanced its human capital development program. As a result, Accenture's stock has grown an average of 13% annually over the past five years.

When you're studying a company, consider how it treats each of the three groups on which it depends. Companies that address all three well, like the examples above, can not only be great businesses, but also great investments.

For more great stock ideas, get The Motley Fool's free report, 5 Stocks The Motley Fool Owns ... And You Should Too.