Long-term investing would not necessarily be described as exciting. And buying a stock and leaving it alone for 30 (or more) years doesn't require much thinking at all. People like to do things that make them feel smart or at least offer some excitement. So long-term investing takes a certain discipline to see the thought involved and feel the eventual excitement it creates.

When you take a stake in a great company before everyone else sees that it's great and you have the patience to wait for it to succeed, you discover that you were lucky enough to own a share in what they're doing, and you profit handsomely from the hard work they put in as much as they do.

In the case of Amazon (AMZN 0.58%) and Microsoft (MSFT -0.18%), following such a strategy would have led to astronomical gains for the early investors who stayed patient. As little as $1,000 split equally between those two stocks at their initial public offerings (IPOs) would be worth a life-changing sum of money today. 

The path to get there might appear boring, but the results sure are exciting. Let's lake a closer look at these two technology giants and see how their investors struck gold. 

1. Amazon: From books to global domination

Amazon arose from humble beginnings. Founder Jeff Bezos was trying to revolutionize retail by proving he could sell books online. Not only did he and the company succeed, but it's now the largest e-commerce company in the world with millions of products on offer. But that's not the only industry it helped pioneer. 

In 2006, Amazon had built out a large IT infrastructure service to help its e-commerce efforts and had an excess capacity which it began offering to other businesses, making it one of the first commercial providers of cloud computing at scale. Fast forward to today, and Amazon Web Services is the largest provider of cloud services in the world, with hundreds of solutions on offer and $76 billion in revenue over the last 12 months.

In true Amazon fashion, it continues to aggressively expand. The company has a booming digital advertising business where it's monetizing its flagship website Amazon.com, which generates 2.6 billion hits per month. And Amazon's opportunity to sell ad spots on its e-commerce website will continue to grow as it dives deeper into streaming through its Prime platform -- rumors are swirling that it's working on a stand-alone app just for its live sports streaming, which already includes hot property like the NFL's Thursday Night Football.

Amazon stock listed publicly on May 15, 1997, at $18 per share, so an investment of $500 (about $928 in today's dollars) back then would have purchased roughly 27 shares. After adjusting for the company's four stock splits, you would have 6,480 shares today with a split-adjusted cost basis of about $0.075 per share.

At Amazon's current stock price of $84.18, your initial $500 outlay would be worth a whopping $545,486 today. And yet, even after all that growth, Amazon's dominant market position in e-commerce and cloud computing -- two key industries of the future -- means it's still a stock worth buying today for continued long-term growth.

2. Microsoft: A trillion-dollar story with billions of customers

Microsoft has a long history as one of the world's most valuable public companies. Today it's valued at about $1.8 trillion, largely because its decades-old Windows and Office 365 software products continue to be used by billions of people globally. And like Amazon, Microsoft has never shied away from entering new territory and expanding its offerings.

Microsoft Azure is the company's flagship cloud services platform for businesses, and it ranks second in the industry behind Amazon Web Services. It's also routinely the fastest-growing piece of Microsoft's entire business.

The company is also building a formidable hardware segment. Its Xbox gaming ecosystem is globally recognized, and its Surface line of notebook computers and devices has become a billion-dollar brand in its own right.

Speaking of gaming, Microsoft is working to close a $68.7 billion deal to acquire video game studio Activision Blizzard which produces popular titles like Call of Duty and World of Warcraft. Some government regulators are working to block the transaction, citing concerns it would give Microsoft too much power over the industry. This battle could drag on for a while, but this potential purchase is further evidence of Microsoft's desire for expansion.

Microsoft's IPO date was March 13, 1986, and it listed at $21 per share. A $500 outlay (about $1,360 in today's dollars) would have bought you just over 23 shares back then. If you adjusted for the company's nine stock splits, you'd have 6,624 shares today with a split-adjusted cost basis of $0.0729 per share.

Given Microsoft's current stock price of $239.73, your initial $500 investment would have grown to a mind-boggling $1.59 million. Microsoft has paid a dividend since 2003, so you would have also collected a cool $167,123 in payments along the way. Those 6,624 shares would generate $18,017 every year in dividends based on Microsoft's current quarterly dividend of $0.68 per share.

Stocks that help you make millions

A mere $1,000 invested between the IPOs of Amazon and Microsoft would have resulted in a return of more than $2 million for those holding on long-term. You'd now own a slice of two of the most diverse, successful technology companies in the world, and they're likely to continue to deliver positive returns long into the future. If you don't own shares in either company yet, it's never too late.