The Microsoft co-founder and multi-billionaire talks about his autobiography in which describes his bizarre working relationship with Bill Gates – and how it was he, not Gates, who had the visionary ideas

Perhaps it's only to be expected, that the co-founders of one of the most powerful corporations on Earth, who have touched the lives of millions of people with products that they dreamed up when they were still kids, should turn out to have been a bit weird. After all, we already knew that Bill Gates had a habit of rocking to and fro when in deep thought, and Paul Allen's decision to build the world's largest privately owned yacht (replete with helicopter landing pads and submarine) is hardly the definition of normality.

But not until now did we know the full extent of Allen and Gates's combined oddity. We didn't know, for instance, that when they got excited they had a way of talking to each other in quick fire that they called "popping up the stack". It meant that they would leap from one subject of conversation to a completely unrelated one, so that if you happened to be listening in to their dialogue you would think they were talking utter gobbledygook.

"So then we can move this string," Gates might say.

"You're right, the other thing will never happen if that's true," would come Allen's rejoinder.

"Exactly! That's the variable we used the last time."

We didn't know either that the pair would go for days and nights struggling with some particularly difficult element of coding then, when they cracked the problem, would roll around the floor giggling hysterically. We didn't know that Gates liked to work in what he called "hardcore" Coca-Cola-fuelled late-night sessions until he would pass out on the office carpet, to the alarm of colleagues. Or that at weekends Allen would give the young Gates – who then weighed barely 50kg – a leg-up into a Dumpster so he could go rummaging around in the office rubbish looking for computer print-outs that would provide clues to early operating systems.

These priceless insights have been brought to us courtesy of Allen himself who, now aged 58 and some 28 years after he quit Microsoft, has finally got around to writing his side of the story. His book is revealing in so many ways, many of them, one suspects, unintended by its author. It illuminates the peculiar cocktail of factors that lay behind the Microsoft miracle – the extraordinary drive, extreme competitiveness, creative brilliance and sheer luck that put the two of them way out in front of the opposition. It exposes the gruelling drudgery that is required to translate great ideas into commercial reality. It unveils Gates's ruthlessness in sweeping out of his way all impediments to success, Allen included. And perhaps most potently, it suggests that even fabulous wealth – Allen is worth $13bn (£7.8bn) – will not buy you satisfaction or heal your wounded pride.

The first thing to strike the reader, though, is how astonishingly young the two of them were when they forged the relationship that would change the world. There is a photo in the book of Allen and Gates soon after they became friends at Lakeside school in Seattle, gathered around one of the lumps of metal that passed as computers in those days. Gates must have been 14 at the time, but with his blond hair and gangly frame looks closer to 9; Allen, all sideburns and corduroy, seems twice his age.

"We were very complementary," Allen says when we meet in Penguin's offices in New York. "From a very young age we both became skilled programmers and knowledgeable about the technology landscape, and excited to do something entrepreneurial. Bill and I were both equally fanatical about learning everything we could."

From the start, it was obvious to Allen that Gates had exceptional qualities. He was smart, competitive and persistent. A couple of years into their friendship, Allen wrote of Gates that he was "very suggestible and is ready to jump at any chance to have fun in strange ways. We fit together very well."

The bond was quaintly touching, knowing what we now know. "Bill and I had a discussion, I remember, probably some time around 1974," Allen says, with a smile. "We said, 'Hey, if we're really successful we could form a company that could grow to around 35 employees.' Microsoft is today north of 90,000 employees. So obviously we blew through our initial hopes and dreams there."

What's striking is that most of that explosive growth occurred after Allen had left the company. When he resigned, in February 1983, the company had a workforce of just 500. Inevitably, perhaps, with the passing of so much time and with Microsoft moving on to new pastures (such as Windows and the Xbox 360), Allen's profile at the forefront of the technology revolution has faded to become something of a spectre – present but only faintly visible. He has become the "other guy", the other founder of the most successful technology company in history, who shares Gates's fabulous riches but little of his recognition or standing on the world stage. And yet in Allen's telling of what happened in those first formative years, it was he, not Gates, who had all the truly visionary ideas. The title of the book alone speaks volumes: Idea Man.

So in the Allen version it was he who came up with the groundbreaking idea that they could write a BASIC software that would unlock the holy grail of the personal computer – the birth of a world in which computers would become so cheap and user-friendly they would be in every home. Gates at first tried to pooh-pooh the idea, he claims, insisting on waiting until more powerful hardware came on the market. Later, it was Allen, not Gates, who created the SoftCard, allowing a popular operating system to be run on Apple computers. It was Allen, not Gates, for heaven's sake, who came up with the name Microsoft (an earlier frontrunner had been Allen & Gates – note whose name came first – but that was deemed too much like a law firm).

As Allen describes their relationship, he would come up with great innovations that Gates would make happen. "During the founding first eight years my ideas were definitely key to the company. Bill would test my ideas. I would come to him with another 10 ideas that never went anywhere – he was the sanity check on the flow of ideas. When it came to selling and marketing and staffing and all those kinds of things, he was much more excited on the business side, so we became very complementary."

This depiction, of Allen as visionary, Gates as glorified salesman, is an extremely radical retelling of the Microsoft story, and it makes me wonder what Allen is seeking to achieve in putting it out there for public consumption after all these years. Is he trying to create a legacy that has got somewhat lost in the way the story has usually been told?

"I don't know about lost," he says. "I just felt it was important to tell my side of the story in as accurate a way as we could. We have hundreds of hours of interviews with people involved, and we have documents. Nobody has contradicted anything in the book on the record. It is what it is."

But any lay person would say the most important part of a technology company is the ideas.

"Right, right," Allen says.

And in the book you write that several of the key ideas were yours.

"Yup."

So instead of the 60%-40% split that Gates insisted on at the start of the company, in favour of Gates, shouldn't it have been the other way round?

"Well, at the time, Bill made an argument that I was getting a salary while he was still at Harvard making no money. I could see the logic of that. Maybe I could have argued more forcefully for the value of my original idea, but at the time I agreed to it."

A politician's answer. I try a slightly different tack. So are you trying, I ask, to come to some resolution over the Microsoft years, to put to rest the feeling that you had all the big ideas that were never fully recognised?

"It has nothing to do with recognition," he replies. "There were some things that nobody had ever really talked about – the final elements that led to my departure. I thought I should just record those. But at the time those things have a real power. I was really surprised. I was stunned and disappointed."

He is alluding to the parts of the book in which he recalls the harsher side of Gates's character, anecdotes from the early days that portray Gates in such a poor light they make the reader cringe with embarrassment for him. Such as the fact that Allen stopped playing chess with Gates after only a few games because Gates was such a bad loser he would sweep the pieces to the floor in anger; or how Gates would prowl the company car park at weekends to check on who had come in to work; or the way he would browbeat Allen and other senior colleagues, launching tirades at them and putting them down with the classic denigrating comment: "That's the stupidest fucking thing I've ever heard!"

Worst of all was the way Gates tried to maximise the money for himself, at Allen's expense. After insisting on a 60-40 split in his favour at first, Gates then renegotiated the terms of their partnership to give himself 64-36. As the final insult, Allen overheard Gates discussing with Steve Ballmer (now Microsoft's CEO) how to dilute Allen's equity in the company, complaining that he was so unproductive. Allen was fighting his first bout of life-threatening cancer at the time. "This is unbelievable! It shows your true character, once and for all," Allen said, bursting in.

In some of the US reviews of Idea Man, critics have accused Allen of being driven by bitterness. Is he bitter?

"I don't think the book is bitter at all. I think it's a direct telling of what happened, and tries to give you a real feel of the personalities involved."

He adds that much of the disappointment he felt at what he calls their "failed romance" has faded. "After a few years all that passes. Bill and I have always been friends, even through the ups and downs, and there have been some. Those events were in 1982, there's been a lot of water under the bridge since then."

In Allen's case, much of that water relates to the rather enviable question that he seeks to answer in the later chapters of the book: what do you do if you are a billionaire by the age of 37 and 10 times that by 43? What on earth do you do with all that money? It's a question I'd quite like to have to wrestle with myself, I say, though the quip singularly fails to elicit even a smile from Allen.

As it happens, the answer is quite straightforward, at least it is if you are a boy. You spend billions of dollars playing with boys' toys: you buy a basketball team and an American football team and mingle with the stars of the sporting world. You revel in your passion for music, jamming with Mick Jagger and Bono and hanging out with Paul McCartney and Peter Gabriel. You indulge your love of Jimi Hendrix by buying the white Stratocaster he played at Woodstock and many other artefacts, then get Frank Gehry to design one of his trademark buildings in Seattle to house them. You play with rockets, pumping millions into the private space programme SpaceShipOne. Because you've always loved going to the cinema, you invest in DreamWorks when it is founded.

Not to mention Octopus, that yacht he had built, all 126 metres of it, with a full-time crew of more than 50, an industry-standard recording studio, cinema, basketball court and swimming pool, in addition to the helicopter pads and eight-person submarine. That has got to be the ultimate boy's toy, I suggest.

He gives a rare belly laugh, and says: "I don't know about a toy. It's another kind of platform for exploration, though it is big, much bigger than I expected."

Admit it, I say, despite the name of the band you formed, Grown Men, you really never have grown up, have you?

"Yeah. You love these things when you are young, and then you have a chance to realise them . . ."

He pauses, before adding: "Hopefully, you try and do things that will change the world as well."

The changing the world part has risen up his list of priorities in recent years, not least since 2009 when he had his second, unrelated tussle with death in the form of non-Hodgkin's lymphoma. By the time it was detected, it had already spread to his lymph nodes.

After intensive chemotherapy, he is now in remission. He is tested every few months and is hoping that if he remains clear for a few more years he will be considered cured. He's found ways to cope with the terror of not knowing about the future – friends, working on the book, keeping positive – but he says it has changed his outlook. "All of this reminds you of the fragility of your life, that all of us have only so much time to enjoy life, to do good things, and hopefully make the world a better place."

He's increasingly focusing his time and riches on scientific research into the brain. And he has joined Bill and Melinda Gates billionaire's club where members pledge to give away most of their wealth. Bill Gates again! Isn't he bored rigid of having that man loom over him all over again with his "philanthro-capitalism"? Allen is gracious in reply. "Bill's taken on some huge global health challenges in a great way. He's done some great stuff."

And their relationship today?

"He came to visit me a number of times when I was resting after chemotherapy. I really appreciated it."

What about the book? Gates put out a statement after it was published in the US saying he remembered several of the key Microsoft events differently.

"We haven't had the chance to discuss the details of the book yet. I think Bill was a bit surprised by some of the elements in it, and he'll want to have a very intense discussion about that. That's the way Bill is."

Where will you meet to have the showdown, I ask. He laughs out loud a second time. "Maybe he'll come to my house. Maybe it'll be in a public place so our voices can't be raised too much. Not in a lawyer's office, please."