Melancholia begins with a wedding and ends with a funeral. Actually, the new film from Danish provocateur Lars von Trier ends with the apocalypse – a funeral for everyone, as a vast planet rears up on the near horizon, lighting up the lawn and setting the birds chattering. Watching the movie at this year's Cannes film festival, Kirsten Dunst was surprised to find herself giggling, as if this was some sort of happy ending. "That's one thing you can say for the end of the world," she says. "It solves a lot of problems."

We're drinking coffee in the basement of a London hotel, with embroidered snowflakes on the wallpaper and an Indian summer raging outside. The actor is attired as though for a night on the town – sheer black dress, jingling silver bracelet – even though it's mid-morning and she has yet to eat breakfast. She confesses that she keeps staring at the snowflakes, her eyes glazing over, her mind zoning out. At lunchtime, she is due to board a flight home to New York, after which she has a clean slate for the rest of the year. You get the impression she can't wait to put 2011 behind her.

Certainly, Melancholia has been a torrid passage for its 29-year-old star: a typical Von Trier rollercoaster that places soaring triumph cheek-by-jowl with low-comedy disaster. On the upside is Dunst's performance, a role that is worlds away from the studio fluff that has taken too much of her recent energies. She plays Justine, the brilliant, dark-eyed manic-depressive heroine, who stumbles through the worst wedding ceremony this side of Festen and then belatedly comes into her own as judgment day looms. It's a devastating performance, and one that won her a deserved best actress prize at Cannes.

And yet, for all that, the film risked being upstaged by the press conference that followed its screening. Riffing off a question about his German roots and his interest in "the Nazi aesthetic", Von Trier joked that he was a Nazi and that he "understood Hitler". Within hours the story had gone viral, prompting the Cannes organisers to expel Von Trier from the Croisette. The defining image from this year's festival may have been the sight of a stricken Dunst at the director's side, clutching her throat in anguish.

She winces at the memory. "Well yeah, you could see my face. I was choking, because I'm watching a friend having a meltdown. And what he's saying is horrendous in a roomful of press. He was asked an inappropriate question [about his family] and his response was to make a joke about it. But no one laughed and he just kept unravelling."

'I was the one who stopped Lars'

The way she sees it, the incident was a perfect storm of unstable elements, with her caught haplessly in the middle. She blames the journalist, the British film critic Kate Muir, who opened the floodgate – and the floodgate itself for opening so readily ("Lars always likes to stir things up"). But she also seems narked with her other cast members, who simply sat by. "That's what I don't understand. There were a lot of us sitting there. There was Stellan [Skarsgård], John [Hurt], Charlotte [Gainsbourg]. And no one said something. No one wanted to help. I was the only one to lean in to Lars and get him to stop." She rolls her eyes. "And, of course, I'm the one person that people would love to rope into that situation. They'd love to mess with me."

Why? Because she's a Hollywood star? "Right! So then I become the story. It becomes, 'Oooh, look at Kirsten's reaction!'"

Presumably this is the hazard for any big-name actor who works with Von Trier. The man has a reputation for putting his performers in compromising positions, both on and off the screen – and when that performer is the American sweetheart from Spider-Man, Bring It On and Mona Lisa Smile, it only ups the ante. I tell Dunst that I want to read her a quote from that day's Guardian. It's from an interview with Paul Bettany, who worked with Dunst on the duff romcom Wimbledon, but who also had a starring role in Von Trier's Dogville back in 2003.

"Oh, I know," Dunst interrupts, mid-sip. "I love Paul, but I know he hates Lars." The quote suggests that Dogville was a nightmare to make. Von Trier, says Bettany, has no interest in letting the actor be a part of the process. They are merely his puppets.

"Wow," she says. "They must really have hated each other." She insists that her experience was nothing like that. "I've felt like a puppet on films before and have been really frustrated and angry. I mean, Lars might see himself as some master manipulator, but that's not how he comes across. I mean, most of the scenes were improvised and he doesn't even say much. How can that make me his puppet?"

Look, she says: she agreed to make Melancholia because she loved the script. It's not as if he had asked her to make Antichrist, the director's previous film, in which Charlotte Gainsbourg played a bereaved mother who mutilates her own genitals. "That kind of film is harder for someone like me to get away with. I'm more in the public eye than Charlotte." She pauses to reconsider. "It's something about Charlotte's body, too. You couldn't have someone like me, with big breasts, in that film. Charlotte's thin and her breasts are small and that's easier to watch somehow. For someone like me to do that film – it would almost be ridiculously shocking."

It was, she recalls, fun to make. "It never felt like work, that's for sure. Brad and Tom treated me like their little sister, their little princess. But I think children handle things better than adults. As an adult, you get insecure. You're tired, you're worried about how you look and what it all means. When you're a kid, you just think, 'Oh, I like my dress. Let's go and play!'" She shrugs. "Plus I had nothing to lose. People aren't going to tear down a 12-year-old kid."

Life has inevitably grown more complicated since then. In 2008, suffering from depression, Dunst briefly checked into the Cirque Lodge centre in Utah. According to Von Trier, this experience was crucial in her interpretation of Justine, whose pristine, successful exterior is but the sugar-coating on a core of pitch-black misery. "She's one hell of an actress," the director has said. "She is much more nuanced than I thought and she has the advantage of having had a depression of her own. All sensible people have."

One apartment, one bedroom

Dunst gropes for the coffee. Yeah, she says. But it's a difficult issue for her. On the one hand, she doesn't want depression to be seen as a stigma, hidden away in the shadows. On the other, it's private. "I'm not comfortable discussing it, even with people I know."

To casual onlookers, Dunst is someone who appears to have it all. So is the stigma different when it affects a Hollywood movie star? Is it worse? "It's something human beings go through, regardless of who they are. And yeah, I have a good job and people like to build me up as having a certain lifestyle. But I've got a pretty good head on my shoulders. I support my family and I'm careful with money. I have one apartment in New York, it's got one bedroom." She plucks at her bracelet. "This is borrowed." She plucks at her dress. "This is borrowed. So it's not like I'm living this crazy life with town cars and buying myself jewellery."

She stares at the snowflakes. "But OK, we got kind of off the subject there. Depression can happen to anyone, obviously. And it's different for everyone. But I guess I'm just trying to divert the conversation."

Time is up. She's all set to fly home, escaping Melancholia's orbit for good. She has another job lined up for January, but until then she's free. She wants to read; she'd like to write. At some stage, she'd like to move into producing. For the next three months, however, the priority is home and hearth. "I'm going to chill with my family. I'm planning to stay with my mom and my grandmother. And my cousin's living there, too, at the moment. So it's basically a lot of women in a house and we sit around and watch Jeopardy."

Still living dangerously, then? "Oh yeah," says Dunst. "You can never get enough of Jeopardy."

Anne Billson: By warning us in advance that Bruce Willis or Tom Cruise isn't going to save the day, Lars Von Trier's Melancholia joins the fine tradition of films that preview their own coming attractions