All there is to investing is picking good stocks at good times and staying with them as long as they remain good companies.
-- Warren Buffett 

Costco Wholesale (NASDAQ:COST) is one of the "good" companies. Co-founded by James Sinegal with one warehouse store in Seattle in 1976, Costco has grown mightily over the years based on a simple set of tenets: Sell quality merchandise at low prices, invest generously in your employees, and treat people (including suppliers) with fairness, dignity, and respect. 

Of course, selling at low prices is an understatement for Costco. The company operates on razor-thin margins. Last year, it earned $3.13 billion on $138 billion in sales. That's a profit margin of 2.3%, a major improvement from where it was 10 years ago. And keep in mind that virtually all of Costco's profit is derived from membership fees, which means it's selling everything at just enough of a gross profit to cover operating expenses. 

Stacks of coins with the overlay of a clock and stock quotes.

Image source: Getty Images.

You'd have nearly $900,000

So, if you had dropped $5,000 on the stock at its initial public offering and stuck with it over all these years, how much money would you have?

Costco Wholesale went public on Dec. 5, 1985. The initial price per share was $10, so a $5,000 investment would have purchased 500 shares. However, the stock has split four times, so you would own 3,000 shares today. When a stock splits, you receive more shares but the stock price is adjusted proportionally so the value of your investment stays the same.

Currently, Costco trades just under $300 per share, so your investment would be worth approximately $900,000. If you're curious what that translates to in terms of an annual percentage, that's a compound annual return rate of 16.5% per year. 

You wouldn't quite be a Costco millionaire yet, but we haven't considered dividends.

Dividends matter

Costco paid its first dividend in 2004 at the rate of $0.10 per share quarterly. The company has continued to grow, and the dividends, too. The current quarterly payout is $0.65 per share.

Those 3,000 shares would be earning you $1,950 per quarter, or $7,800 per year in dividend income. That's quite a chunk of cash to grow the cash balance in your brokerage account.

But it gets better. Costco sometimes pays out a special dividend, which is much higher than the regular quarterly rate. For example, the last special dividend paid out was in 2017, when Costco returned $7 per share in cash to shareholders on top of the quarterly dividend at the time of $0.50 per share. 

When including dividends, the total returns would be worth over $1 million by now, especially if you had been reinvesting those dividends along the way.