I was reading a book on Project Gutenberg in 2003 and thought the UX was hideous at the time.
I wanted to be able to save my progress, highlight things, talk to other people reading the same book, etc.
Since it was all in the public domain (out of copyright), I decided to scratch my own itch and create a better wrapper for those books. It took a weekend to create the site from start to finish. The experience was similar to what apps like iBooks provide today (which didn't exist at the time).
After contacting some college libraries to alert them about the site I created, I forgot about it and got back to work.
A week later the site got featured on BBC World News and went viral. Traffic went from 0 to 100K unique visitors the first month.
Links from authority sites poured in and the site's Google PageRank (this was 2003) shot up to PR7.
A few years passed and the traffic grew to ~500K unique visitors a month and it received press almost automatically. The most prominent was landing on TIME Magazine's top 50 websites list.
A couple of unobtrusive AdSense units on the site were enough to generate $9K a month in revenue -- which was pretty much all profit since the cost to run the site was a $20 VPS.
After 7 years of generating a passive income with minimal time investment (apart from the original work done years ago), I decided to sell the site and invest the proceeds from the sale into another business.
The site now is drastically different from what it was pre-acquisition. If I had to do it all over again, I would not sell it. The take away for me was to build assets, not sell them.
Seeing as nobody shared experiences referenced I will take a stab at answering this.
The phrase "end up generating revenue" implies that it was somehow incidental and not as a result of some effort from the product maker. I would speculate this doesn't happen for software projects very often, but perhaps with blogs since blogs are commonly monetized with ads with minimal setup effort.
I am sure people build useful utility apps for themselves and end up selling those to companies or directly, but I would speculate that "generating decent revenue" route always takes some effort and isn't sustainable without ongoing effort.
A couple of examples of relatively easy money that might not fit an idea of a "project":
1. Posting a viral video on Youtube and getting $ from the ads rev share. There was a post on Reddit a few weeks ago - the OP checked his account and discovered he had $17K balance from an old video that became popular, sorry too lazy to search for it to link. In this case he was surprised and didn't expect it. Anyone remembers the bouncing twins to dady's guitar? They made it into a google ad on top of the $ they got from Youtube ads, surely they didn't intend to make a lot of money when recording that home video. Top earners on Youtube make 7 figures.
2. Inventing something and licensing out an idea to a company, get residual income.