Instead of doing the OS themselves (as they had said), they went to a neighbouring company who was working on a direct rip-off of CP/M (that wasn't that good a rip-off either). This company was Seattle Computing and the product was QDOS (Quick & Dirty Operating System). MS bought all the rights for $50,000 (or $40K - $100K depending on who you talk to), and with a few changes the work was complete. Microsoft had, for a song, IBM-DOS and MS-DOS 1.0 (the same products, but different names).
The first computer that I ever purchased, long before the IBM PC (8086 processor) was an AppleIIe Europlus with 48kb of ram. It came with Applesoft Basic, which was written by Microsoft and was the closest thing to DOS in terms of making the computer useable until they brought out Apple DOS 3.x . I believe I may still have the manuals for it.
While MSDos had the same front-end as CPM, it was an entirely different code. CPM was written for the Zilog Z80 processor. If you know anything at all about operating systems, you would know that you have to cut entirely different code for each processor. While it may be fashionable to constantly bag Microsoft, one should know what they are talking about. That code was generally written in machine code.
To say that PCDos/MSDos is a direct rip-off of CPM is like saying the Chevy Volt is a direct rip-off of a skaeboard.
When IBM had decided to produce a Personal Computer ('PC' is a term coined by IBM), they decided on having an open architecture machine (the guts are accessible and customizable through expansion slots) and as many off-the-shelf components as possible in order to get it into the market ASAP. CPM was owned by Digital Research, so some top guys from IBM in New York made an appointment to see the guys at DR (in San Francisco, I think). When the IBM guys arrived at DR after having flown across the country, the main person with whom the meeting was set up was out flying his private plane, and the other partner sent his wife to the door to tell the IBM folk that they were not interested! After some discussion, one of the IBM guys said he had heard of a guy named Bill Gates in Seattle who was very intelligent and experienced in MS Basic language and in operating systems, like Apple DOS.
They went up to Seattle after making an appointment with Bill Gates. They showed him the CPM manual and Bill already had one. They wanted an operating system for the Intel 8086 (?) with basically the same front end as CPM. Bill Gates said they could do the job. He discovered that Seattle Computer was working on an OS for the Intel chip and so contracted them to continue their coding but to have a similar front-end to CPM. The rest, as they say, is history.
Also, I believe that most versions of the Basic programming language came directly or indirectly from Microsoft.
If you want a really good read, go to your library and borrow Hard Drive, an account of Microsoft's early years. For quite a while, even though Bill Gates was the owner of the company, he paid two (?) of Microsoft's employees more than he paid himself.