Sir Ian McKellen ambles into a fifth-floor room at London's Claridges.

"I've not done my homework," he announces, staring at the piece of paper the publicist has just handed him, making him aware of who I am. He peers over his glasses, his mind ticking away, takes note and moves on. We've met before - several times - but I wouldn't expect him to remember.

The first time was at a party for Gods and Monsters, still one of his best films, where we chatted quite freely. Full of bonhomie, McKellen always chats freely. That was 1998.

At the time, he was still a largely unknown quantity in Hollywood. He'd just made Apt Pupil with director Bryan Singer, playing a Nazi-in-hiding. An impressed Singer had seen McKellen's 1995 film version of Richard III, which the actor had co-scripted (garnering him BAFTA and Golden Globe nominations). From there, McKellen had been offered a role in Mission: Impossible II, as the villain opposite Tom Cruise, but when they wouldn't send him a complete script, he turned them down.

Thank heavens he did: the film's lengthy shoot overran and he would've lost out on reuniting with Singer on X-Men, back in 2000. Cast as the metal-bending mutant villain Magneto, it's been one of two roles that has sent McKellen into the Hollywood firmament in the autumn of his career. The other, of course, is Gandalf the Grey, the wise wizard who strides his way through both Tolkien's Lord of the Rings and The Hobbit - slavishly, skilfully adapted for the big screen by Peter Jackson over these past years.

"It's been a very happy past couple of decades," he smiles, settling into his chair and taking delivery of a frothy-looking latte. "I still can't quite believe it."

For years, McKellen was a respected stage actor at the Royal Shakespeare Company and Royal National Theatre who had to stand by and watch his contemporaries - Alan Bates, Albert Finney et al - all make the transition to the big screen. Since landing the roles of Magneto and Gandalf, for which he was nominated for a second Oscar, after his turn as Frankenstein director James Whale in Gods and Monsters, he's eclipsed them all.

Of course, Hollywood is one thing. For McKellen, he's always maintained the moment he came out and admitted he was gay, his life - professional and personal - changed for the better. That was back in 1988, when he was 49. Famously, he revealed all on a BBC radio show. He became the co-founder of LGBT group Stonewall (and is still very active, even touring British schools to talk about the organisation's campaign to tackle homophobic bullying in the playground).

The whole process of coming out was a "joy" - not least because it allowed him to "join the company of other people, who'd been on their own journey and were able to come out, and together, stand up for other people who weren't able to come out. To have been through that journey, hard as it was and cruel as it was, and as unnecessary as it was, it's been a wonderful journey to go through. I feel that, although rejected by society, I've helped to change it."

Today, he's wearing a shiny grey suit, white shirt and brown casual shoes - a pair that don't match the rest of his outfit, but given how comfy they look for his poor feet, we'll forgive the brief fashion faux pas. Turning 75 at the end of this month, his hair is white and a bit wild, and there are specs of grey stubble across his chin. Grooming yourself to look like a GQ model isn't high on his list of priorities. But his mind is still tack-sharp and - despite dental implants, a hearing aid and a prostate cancer scare - he still has his health.

He also still has a flourishing career, retirement but a distant dream. He's back this month as Magneto in X-Men: Days of Future Past, one of the summer's most anticipated blockbusters. For once, the hype is more than justified - with a time-travelling story that sets out to integrate the original cast members (including McKellen) with their younger selves, as seen in 2011's prequel X-Men: First Class. The budget is said to be $225 million, so you might imagine that Twentieth Century Fox - the financing studio behind the film - are glad of McKellen's support.

"I was just telling the Fox people that when they put something on their website for X-Men, and then I put it on my website (mckellen.com) more people read it on my website!" he beams. "I have got two-and-a-half million followers." His site, a rather sweetly archaic-looking thing, features an in-depth bio that he's written - which, he says, prevents the need to ever pen an autobiography. There's even a picture of the house he was born in and the Granada Television-sponsored plaque that was put up to commemorate his birth.

He says he's "interested in publicity" - in what makes the public go and see a movie or play or read a specific book. And he's intrigued by social media. "It's word-of-mouth. It's not strictly publicity. And you" - he says, looking directly at me - "don't get in the way. I can talk directly to people I want to talk to." Still, he's yet to join the revolution. "I'm not on social media at all," he says. "I don't even text." He took his mobile with him to New York last year for his nine-month stint on Broadway. "My phone didn't ring once and I didn't make a phone call on it. I'm a dinosaur!"

Out of duty, we talk about X-Men. Had he seen Michael Fassbender, when he played the younger Magneto? "Oh, briefly!" he says, with a sort of cheeky dismissive wave of his hand. "No, he was very good. Very good. I did read an interview where he said he hadn't watched the previous ones, because he wanted to do something entirely different. Well, I think that's the sort of thing I would've said if I'd been taking over." They did meet, but only once, at Comic-Con - the huge geek get-together where film studios regularly send actors to promote fantasy movies.

It'll be the fifth time McKellen has played Magneto - or 'Magnet-o' as he puts it, reminding me of the official pronunciation from the original Marvel Comics that's got rather lost. What hasn't got lost is the notion of the X-Men characters - mutant outsiders with special powers - as a metaphor for those on the fringes of society. "The demographic for the comics is young blacks, young Jews and young gays. They're the ones that made those X-Men comics popular," says McKellen.

Needless to say, with his gay activism, such a story was going to peak his interest. "Bryan Singer, who directed the first two X-Men films and returns for Days of Future Past, was clear when he asked me to do it. He said, 'It's a gay metaphor.' It's not just a fantasy story. It's not just fancy costumes. It's about something. In the second movie (2003's X2) one of the mutants comes out to his parents. You can't write off the X-Men movies. They're about something."

The big draw for McKellen was reuniting again with Singer. Calling his friend and director "a very generous host", he then begins to tell a particularly amusing story about Singer taking him to the star-studded White House Correspondents' Dinner. "We're sitting there having dinner and there, behind a little red rope, is the President of the United States - eating! You can't help gawp, can you?" he chuckles. "Bryan said 'Hi!' and Obama says to Bryan, 'Hi!', and then pointed at me and said, 'Great actor!' I practically curtsied!' It turns out he's a fan of the X-Men movies!"

McKellen's chest practically puffs out in pride went he mentions this. So does this mean he gets star-struck? "You can't be interested in politics and not be interested in Barack Obama, can you? I went to his inauguration. Oh, well, yes, like anybody...I don't think you ever get used to meeting a famous person who you admire." He recalls when fans flocked to the stage door last year, where he and his X-Men co-star Patrick Stewart performed in both Samuel Beckett's Waiting For Godot and Harold Pinter's No Man's Land on Broadway.

"There'd be 200 people there," he says. "And if they wanted a selfie...do you know what a selfie is?" I nod, mildly amused. "You just put your arm around them, you discover that they're shaking. Well, you try not to take that personally because you might get the wrong idea about yourself. It is a huge moment for people when they see made flesh an image they're familiar with and they like. I'm exactly the same. If I were to meet Brad Pitt or George Clooney...I'd love to meet George Clooney and I'm sure I would be like a little groupie!"

What's surprising is quite how McKellen hasn't managed to meet George Clooney yet. Arguably, he's too busy spending time with his "bestie" Patrick Stewart (one website, on seeing frequent pictures on Twitter of the two hanging out off-stage in New York - including a glorious one of them with their arms around Sesame Street's Elmo - described it as "the best bromance of 2013"). "I've married him, you know," McKellen notes, referring to the fact he officiated at Stewart's third wedding, conducting the ceremony.

Even McKellen, a dyed-in-the-wool Lancastrian, doesn't really understand how he's come to be such close friends with the Yorkshire-born Stewart. "The War of the Roses, it's a big part of history and it carries on in sport to this day," he states. "Yorkshiremen and Lancastrians don't get on. So how can I love Patrick? It's one of the mysteries. There should be a whole film series about it!" I put it to him that really the X-Men films are a metaphor for the Tudor wars and he bursts out laughing.

Born in Burnley, where his father Dennis was a civil engineer, he came into the world shortly before the outbreak of the Second World War. It was his parents who stimulated an early interest in the arts, taking him to a production of Peter Pan at Manchester Opera House when he was three. Later, his older sister Jean - who would go on to act, direct and produce amateur theatre - introduced him to Shakespeare, with local productions of Twelfth Night, Macbeth and A Midsummer Night's Dream.

He avidly read comics too, though the American efforts - Marvel's prior incarnation, Timely, began in 1939, the year McKellen was born - weren't available to him. "I didn't see those. It was Dandy, Beano and The Eagle that I read, which didn't have these epic stories in them. I remember getting the very first issue of The Eagle when I was about nine years old. I didn't hang onto it, but I remember it smelt very strongly of the printer ink - and it was in colour which was unusual for printing in those days."

While his mother died when he was 12, McKellen's school days, and then his time at Cambridge, was dominated by acting. Graduating in 1961, his first professional appearance was playing Roper in A Man For All Seasons. He moved to London, soon to join Laurence Olivier's National Theatre Company at the Old Vic, and began living with his first lover, a history teacher named Brian; one of his big regrets, he says, was not having the chance to tell his family that he was gay. His father died in a car crash when he was 24.

When he eventually told his stepmother Gladys (who lived to the age of 100), she said she'd known all along. We start talking about life-changing moments, like this. Is he the sort that's ever popped open a bottle of champagne to celebrate something? "I'm just trying to think of an absolute thrill in my life," he muses. A CBE in 1979, a knighthood in 1992 - he's had a few highs. "I suppose if you got down on your knee and said, 'Would you marry me?', I'd crack open the champagne..." He is, I think, talking generally, rather than to me.

The change in the laws surrounding gay marriage came too late, perhaps, for McKellen. He spent almost a decade with theatre director Sean Mathias, until it came to an end in 1988. They've remained friends, business partners - co-owning the East London pub The Grapes, in Limehouse where McKellen lives - and collaborators, with Mathias being behind McKellen's recent Godot/Pinter stint. "I can't imagine my life without Sean, particularly because we're such good friends and he leads such an interesting life," McKellen told one writer recently.

His last significant other was Nick Cuthell, a young New Zealand model, some 40 years his junior, whom he met while shooting Lord of the Rings. And now? "I'm not available! I'm not looking," he says, hurriedly. He likes living alone. But, looking back, is there anything he'd change? "Personally, I wish I'd known when I was young that I was quite attractive. What advantage I would have taken of it, who knows? I don't think I was as outgoing as I could've been. All my regrets in that area were tied up with being gay and living at a time when it was illegal to be gay."

Later this year, we'll see McKellen in The Hobbit: The Battle of the Five Armies - the final chapter of Peter Jackson's adaptation of Tolkien's book. Which means, after 15 years and six films, we must bid farewell to his character Gandalf. While he has the wizard's prop sword at home as a memento, does he feel like this illustrious chapter of his life is finally coming to an end? "It's difficult to think that it's ever actually over!" he smiles. "Here we are again talking about it, which revives it all. Gandalf is an ever-present part of my life."

So, it seems, is hard work. McKellen is about to start shooting A Slight Trick of the Mind, adding Sherlock Holmes to his repertoire. Reuniting with Bill Condon, who directed him on Gods and Monsters, his Holmes will be without a Dr Watson, and - presumably - less hyperactive than recent Robert Downey Jr or Benedict Cumberbatch incarnations. "Our Holmes is likely to be a bit different", he promises.

He's not a workaholic, though. When you're about to hit the three-quarter of a century mark, you can afford a lazy day once in a while. "To wake up on a sunny day in my own home - I have a lovely home - and look in the diary and there's nothing in it, and think 'I'll stay in bed for another half hour!'…I invite somebody around, I go out, I won't go out. I pick up a book - wonderful." His blue eyes shine. "It's a happy state to be in."

X-Men: Days of Future Past (12A)