I meet Edmund White a few days before Christmas and a month after he has suffered a minor stroke; he is cautiously recovering in his Manhattan flat. On Christmas Eve, White, a little breathless but otherwise unbowed, is throwing a dinner party here for an unlikely group of people: "my first boy lover, my first girl lover and their respective mates", plus his partner of many years, Michael Carroll. It is White's contention, explored in his new novel, Jack Holmes and his Friend, that by and large gay men manage friendship, particularly with their exes, better than heterosexuals. "That's the family," he says and smiles.

White's 12th novel focuses on a category of friendship not often depicted, a life-long relationship between a straight man, Will Wright, and his gay friend from college, Jack Holmes, each repressed in his way and struggling to find himself. Neither character is White, although he borrowed heavily from his own life: Will is from a wealthy, conservative family, as was the author, and Jack starts out as a lowly caption writer at a magazine, as did White for Time-Life books. The difference, he says demurely, is that "he's very handsome – more than I am – and he's not at all ambitious". The straight man is initially the more repressed of the two, perhaps having more social capital to lose given the novel's early 60s, pre-Stonewall setting, whereas Jack, after coming to New York from college in the midwest, abandons the idea of conventionality and throws himself into the fray.

Such was White's experience, arriving in the city in that era after studying at the University of Michigan. The career that followed, once he got out of the caption-writing business, was in some ways exactly what he had dreamed of as a teenager in Chicago: to become a writer, to go to New York and then Paris, and to "know everybody", which he says has been the case. His reputation as a novelist – his best-known novel, A Boy's Own Story, was published in 1982 and helped him win a Guggenheim fellowship – is equalled by his standing as a man of epic social mobility (he managed to cadge an endorsement from Nabokov for one of his novels; on the wall of his apartment are photos of him taken with Truman Capote and two portraits of him taken by Robert Mapplethorpe) and delightful indiscretion, about himself as much as the famous names he has come across.

White came of age in an era when homosexuality was still criminalised; the first psychoanalyst he went to told him he was ill and needed to be cured, so that he could go on and get married. Later, he found a gay psychoanalyst, Charles Silverstein, who undid some of the damage and with whom he authored The Joy of Gay Sex. His mother and father, who divorced when White was still a child, were, respectively, supportive (his mother, a psychologist, gave him the confidence to come out at the age of 13 or 14 – "I think I saw myself as an interesting case") and appalled (his father was a wealthy businessman, whose second wife tore his son's reviews out of the newspaper so he would not read and be upset by them).

White's writing has been praised as precise, lean, immensely readable, full of elegant phrasing and casually dispatched observations of the American class system. In the new novel, a boy's hips are described as "only an octave wide". The editor of the pretentious magazine Jack works for "treated his present job as if it were a hobby, some sort of genteel re-enactment on his lawn of a real battle he'd once conducted as a general". Will, in his early 20s, is the kind of guy who "maintained the boarding school pose of licking his lips over any dish that wasn't actively repulsive".

White went to a posh boarding school himself, Cranbrook, outside Detroit. He says his childhood was "boring", as is childhood in general – there is an overarching need, he believes, particularly among American writers, to rake over it at the expense of so much else. In his latest novel, White deliberately obscures Jack's background, hinting at some gothic horror that explains his adult behaviour but avoiding any detailed account. White wrote his own memoirs thematically rather than chronologically to avoid giving any serious time to his early years. He thinks French writers have the better approach to childhood: "If there's a very innocent girl in a French novel, she loses her virginity by page two so we can get on with the story."

The one thing he concedes is that growing up wealthy served him well in his impoverished early years in New York, since he was "inoculated against the lure of riches. I never cared about it, because I saw that it didn't make you happy. It always seemed much better to be a writer – a Real Writer – than a successful hack." His first apartment in the city cost $100 a month, and White was able to get by on very little, until A Boy's Own Story won him a measure of security, although he still lives from one pay cheque to the next. It's why he writes a book a year. "The thing that keeps me writing is poverty." In the 1960s, when he was offered the then phenomenal amount of $100,000 a month to work as a scriptwriter for a soap opera, he turned it down. "I didn't want to write that much dialogue – the storyline was determined by somebody else. It seemed like hack work."

Because of these high ideals, it was with some trepidation that in 1977, White agreed to write, with Silverstein, what is, deliciously, his biggest-selling title, The Joy of Gay Sex. He wondered whether it would kill his reputation as a serious person. It didn't – in fact, it gave him a certain amount of political kudos, being the first book of its kind. But it also established him as a commentator on gay life in a way that, he says, has probably been commercially damaging. His father, displaying an attitude prevalent at the time, came once to see one of his plays. "He was with a business associate. And he said, 'what's your play about, the usual?' meaning homosexuality. And I said, 'I'm afraid it is'."

In his fiction, White writes very convincingly about sex – a rare talent. "The key," he says, "is to not write pornography, not to try to arouse the reader. But to describe faithfully and realistically what goes on when you have sex, which is usually comic. Henri Bergson says that comedy is where the material world resists the spiritual impulse." He stifles a giggle. "So, young lovers who run out of a house to get a car to drive off forever, can't get through the door. That would be an example of his idea of comedy. It strikes me that sex is often a failure of the body to deliver the promises of the spirit."

White believes in open relationships: there is a discussion towards the end of Jack Holmes and his Friend in which gay and straight couples discuss the various models available to them after a breakup, the gay male route frequently being to stay friends with the ex, the hetero one rarely achieving this. "I refer to it as Bad Heterosexual Values," he says, smiling.

How does he stay friends with his exes? "The governing metaphor in gay life is the best friend. Even though the Husband comes in briefly, that dies off eventually and you revert to the best friend. With your best friend, you really esteem him and you want him to be happy. And if that means he leaves you for somebody else, OK. Fidelity and even continued sex life is not a prerequisite. What's a prerequisite is tenderness and esteem."

And in most cases, I suppose, no one is financially dependent on the other. "That's true, too. Since there is no societal pressure to stay together, no babies, often no mortgages, usually there are no external pressures. So if you've weathered a number of years together, it's because you have loved one another."

White and his partner are not married and, unless there's a threat to the health coverage that he currently extends to Michael through his teaching post at Princeton, they have no plans to get married. White is not a great fan of the institution. "I was never an assimilationist. I always thought gays had some special mission. Even in this book I suggest that they have better ideas about how to live than straight people do."

He has been critical of what he calls "Blue Chip" gay writers and artists who never fully came out; Jasper Johns, Cy Twombly, John Ashbery and Susan Sontag, all of whom, he writes in City Boy, his memoir of New York in the 60s and 70s, achieved mainstream success partly by downplaying their sexuality and "sailed serenely on, universal and eternal. It paid to stay in the closet, obviously." His friendship with Sontag had been fruitful for White (she promoted him heavily when he was starting out), and ended when he wrote a thinly fictionalised version of her in which she came across as imperious, perverse and slovenly. Of all the people he has offended through his writing, she was the one, he says, who never really forgave him. Although there was also Gore Vidal. The two feuded very publicly a few years ago after White wrote Terre Haute, a play in which he imagined Vidal meeting Timothy McVeigh, the Oklahoma bomber, and which provoked Vidal to respond, shortly afterwards, in the Times: "He's a filthy, low writer. He likes to attack his betters, which means he has a big field to go after." ("I think Gore is a complete lunatic," said White, speaking to Salon, "and it doesn't bother me what he says about me. He's an awful, nasty man.") Now, White says, "it died down. He never sued or anything."

There may be problems with the memoir he is currently writing, of his Paris days. White lived there for 16 years, in the 80s and 90s. "The French are pretty thin-skinned. The few times I mentioned a French writer in City Boy, the relatives would ring up in high dudgeon. I once wrote a mocking review of Marguerite Duras in the New York Review of Books, and good friends of mine in France got very angry."

Two major things happened to White in the early part of that era: he stopped drinking and he was diagnosed as HIV-positive. The first, strangely, was in some ways the greater shift. He had recently given up smoking and as a result was leaning more heavily on his other vices, drinking in particular. There came one evening when he was so drunk he couldn't climb the ladder to the bedroom in his loft. "I thought, this is ludicrous, I'll never have another drink. It's hard to moderate drinking, to say 'I'll only have two', but to stop altogether is easy." It changed his life, transferring his energy "from nighttime, which was wasted and social, to daytime, when I might actually do some writing."

It also made some of his drinking companions seem boring. Christopher Hitchens used to say that he drank to make other people more interesting. White laughs. "Yes. He never slurred. His memory was incredible. He looked pretty awful sometimes. I was in Brazil with him and we were invited to lunch by the pretender to the throne, so it was a rather swell thing. Hitchens arrived in clothes he hadn't changed in three days with a bottle in hand. It was a bit much. So there was visual evidence, but never any spoken evidence. He was very courtly – he liked gay men, and he was always nice to me and my partner. He would always open doors, very sweet."

When White was diagnosed with HIV it was still tantamount to a death sentence. But he was found to be one of the very small percentage of patients termed "slow-progressors". He was never put on AZT, the interim drug "that was so bad and killed so many people. I had wonderful treatment. I've never suffered consequences. Now, I have zero detectable virus, which means I'm not even contagious."

Surely he had some existential reaction to his diagnosis? "I pulled the blankets over my head for a year and didn't do much. I was just worthless, really." White's parents were Christian Scientists, however, and although he is not religious, he says he has picked up some habits of thought from them. When he is ill in a minor way he "forgets" to take his medicine. He admits only reluctantly to feeling unwell. "When I had this stroke, I kept saying to a friend of mine, oh there's nothing wrong. But I couldn't get the words out. Luckily they called an ambulance. I was a master at denial. I still am. I keep saying, oh there's nothing wrong. But my sister was here and said, you're different. You're having trouble talking. There's less excitement in my personality than there used to be."

He has another book out at the moment – Sacred Monsters, an anthology of his essays. There is the Paris memoir, and he has a book review overdue, which he will dispatch in the new year and which he is dragging his feet over ("it took me for ever to read; partly the fault of the author").

Michael is always his first reader and is at present urging him to write less analysis and more action – "scene, scene, scene; dialogue, dialogue, dialogue. Less description, more action. He gave me a lot of Richard Yates books. The page-turning quality." White is, he says, more honest on the page than in person, considering it a greater crime to lie in writing. "From an early age I had the idea that writing was truth-telling. It's on the record. Everybody can see it. Maybe it goes back to the sacred origins of literature – the holy book. There's nothing holy about it for me, but it should be serious and it should be totally transparent." And, in deference to his style and general talent for living, he might have added: fun.