Gates contracted with IBM to manufacture his product. IBM held steadfast to it's design patent after Gates wanted to outsource the exclusives he gave IBM.
Simple response to your statement..... Cart before horse. :-)
He did so by selling a product which he did not yet have. He then approached several operating system designers. One of them sold him Quick and Dirty Operating System, which Bill renamed MSDOS.
He got the money from two places. One was his daddy, an Intellectual Property lawyer and also from sales of his BASIC compiler, which he got by stealing the work of others.
There are a couple of sad points to this. One, he was turned down by the creator of CP/M, which was a pretty good operating system compared to the kludge which was QDOS. Second, he wasn't tossed in jail for his antics. People who get away with crimes like theft and fraud generally go on to perpetuate larger thefts and frauds.