Your question has part of the answer in it.
Let's suppose you have some money, and you construct a house and put it on rent. Now it will continue to generate income. You only invested your time and money once and enjoying the continuous income. I agree that there would be some maintenance involved but that is not equal to the initial investment (unless the house has to be reconstructed).
Now let's suppose you write a book (an intellectual property). You worked hard and got the book in market. People found that book interesting and millions of copies are sold.
On the same lines, you created a software (again an intellectual property). You and your team worked hard for months or years and the software took off. As in the house example, there will definitely be maintenance involved but not as much as the initial investment.
So in all these examples, initial investment of time and money are huge. It is not like selling merchandise.
Here is a Fatwa by Mufti Taqi Usmani.