There are moments when grief still ambushes Sheila Hancock, although it's been 12 years since her husband, the much-mourned actor John Thaw, died.

"It sometimes happens when I'm sitting alone in a nice place such as this, then I miss John a lot," she says, gesturing at the swish decor of Fortnum & Mason's Fountain restaurant in London, where we meet to discuss her latest role - debut novelist in her 80s.

Towards the end of her epic novel, Miss Carter's War, Hancock's heroine, Marguerite, lonely and in her 70s, realises her isolation is not unique when, treating herself one day to tea in Fortnum & Mason's, she becomes fascinated by an elderly woman "sitting majestically erect". She's trying to get the attention of the waiter, who obsequiously attends to everyone else but her. The woman vigorously strikes the sugar bowl with her silver-topped walking stick and sends it crashing to the floor.

For one glorious moment, she commands everyone's attention: "For the two minutes it took to pay the bill and sweep out, the world was aware of her existence. Something of the woman she once was coloured her exit." The waiter ignores Marguerite, too, treating her "with disdain bordering on disgust".

Ah, the invisibility of women of uncertain age. "I actually enjoy being invisible, being ignored. I like watching people," responds Hancock, whose observation of a similar moment one day in another of the store's many restaurants was the inspiration for her book and the reason we're meeting here. Nobody treats the majestically erect and elegant Hancock with disdain - indeed, there's a flurry of panic when she discovers she's mislaid her mobile phone during the photoshoot in the store's boardroom. A search is instigated and a beaming head waiter hands over her phone with a flourish. "So kind!" exclaims Hancock.

Like Marguerite, however, she knows how it feels for a lone woman to shrink into her shell in such surroundings. "I'll look across a restaurant and there'll be an old couple having tea and I'll think, 'It's so bloody unfair - I wish that was us.' The grief is no longer so raw, but I've moved on. It would have been an insult to John's memory not to."

Thaw was, after all, the man who thought she was beautiful and sexy, and told her so every day of the 28 on-off years they were married. "Lovely bum," he used to call her and indeed she still has a fabulous figure. She pauses, then says: "I've a good life; I intend to make the most of the limited time I have left. I've had one date since John died - supper with a man but halfway through I found myself wondering if I'd left my electric blanket on. I couldn't be bothered - it was so good with John. But I've survived," she says, adding that it sometimes worries her that she seems to be cramming too much into the end of her life. "But I'm hungry for it, I'm frantic and selfish for experiences. I've missed doing so many things - I've never been to Glastonbury music festival, for instance. I must do that before I die."

Still as beautiful as a rara avis, a sapphire-eyed, long-necked, long-legged silvery bird, Hancock has certainly survived. Since her "best beloved's" death from cancer of the oesophagus at the age of 60, in February 2002, she's written a hugely successful memoir, The Two Of Us (2004), about their turbulent marriage. An "unintended textbook of grief", it sold more than 700,000 hardback copies and won her the 2005 Author of the Year award. A life-affirming sequel, Just Me (2008), in which she learned how to be alone and to travel adventurously, also became a bestseller.

Her services to drama were recognised in 2011 when she was created a CBE - she already has an OBE. Why she is a not Dame Sheila Hancock is a mystery, although she demurs modestly at the suggestion.

With the aid of hypnotherapy, she's conquered crippling stage fright to return to the theatre, winning an Olivier award in 2007 for her deeply affecting performance as Fraulein Schneider in the musical Cabaret and, more recently, playing the foul-mouthed matriarch of a dysfunctional crime family in the West End comedy Barking In Essex. Her last stage performance ever, she's vowed. But she tells me that perhaps she's not done with the theatre yet, despite the discipline required. "I do wonder whether I can afford to spend another three or four months of my life on stage. Time is running out."

She's also presented TV documentaries on the Brontes, arts, poetry and the suffragettes, and appeared in everything from EastEnders to New Tricks and Game Of Thrones, as well as being a judge on Over The Rainbow. She's done a graceful twirl in a Strictly Come Dancing Christmas special, while her memorable contribution to the series Who Do You Think You Are? unravelled a fascinating mystery surrounding a family photograph of a portrait of an unknown woman, leading to the discovery of German ancestors, the Zurhorsts.

Later this year, she'll be seen in BBC One's three-part supernatural thriller Remember Me, set in a care home and starring Michael Palin. Meanwhile, she continues to work tirelessly for disadvantaged youngsters and campaigns for care for the dying, after opening a dementia ward run by the Quakers - the faith she embraces - in a psychiatric hospital in York. She's involved with another in Portsmouth where, until last year, she was an inspirational Chancellor at the university. (That mantle has since been assumed by her great friend, the writer and performer Sandi Toksvig.) Hancock's "Messiah complex" - Thaw's summing up of her desire to change the world and right society's wrongs - burns bright.

Here she is at 81 - "Bloody 81, I honestly can't believe it" - with another first, a novel. "How absurd is that?" she marvels. Miss Carter's War, an ambitious 400 pages - as much social history as work of fiction - spans the post-war years through the eyes of Marguerite, a Cambridge graduate and a Jean Brodie-esque English teacher (left-leaning, so thankfully minus the fascism of Muriel Spark's creation) at a girls' grammar school, Dartford County Grammar School for Girls, Hancock's alma mater.

"Who'd have thought it - a first-time novelist at my age," she muses, sipping coffee. She remains astonished that she's a published author, despite the enormous sales and acclaim of her previous books.

Born into a working-class family on the Isle of Wight, the younger of two daughters, Hancock was a bright grammar school girl - "and very, very naughty" - although she left Dartford Grammar at 15 to study at the Royal Academy of Dramatic Art, after growing up in pubs and hotels run by her Italian-born father, Enrico Cameron Hancock, and her mother, Ivy Louise. (The origins of the Cameron remain a mystery.) She didn't go to university, though she studied at the Open University later in life.

"I always thought people like me couldn't write; that only posh people wrote books," she says. "I grew up not knowing what university was, honest to God. Nobody where I came from went to university. I'd never heard of it, although my teachers wanted me to go for a state scholarship because I was so bright. I really regret not going. If I had gone to uni, one of the posh ones which my headmistress Miss Fryer, bless her, thought I could get into, I'd have written a novel 50 years ago. I've always felt that I had no entitlement to anything. I've felt disadvantaged, despite being streetwise; I felt so bloody inadequate.

"Then the Royal Shakespeare Company asked me to direct a tour - only because none of the posh, Oxbridge boys wanted to do it. It was a tatty tour in a tent. I chose Daniel Day-Lewis as my leading actor but I still felt inferior," she says. She said the same to me when we met following the publication of Ramblings Of An Actress (1987), her first book, which is out of print but, she notes crisply, available on eBay. The tour was a huge success for Hancock, a boost to her shattered confidence, so she wrote about it in that terrific book.

People like her don't write? Of course they do.

Miss Carter's War is an immensely enjoyable, passionately written saga that is destined to become a favourite with book clubbers, desperate for nostalgia and a courageous, clever, chic heroine. Half-French, half-English, the eponymous Miss Carter has served behind enemy lines with the Special Operations Executive during the war, recalled throughout the novel in powerful, filmic flashbacks.

The "war" of the title, however, is her battle for girls' education and her political engagement as the austere fifties segue into the swinging sixties, seventies, eighties and nineties, until the dark clouds of the Iraq war in 2003 loom on the horizon. The fiery Miss Carter joins the million-strong march against that conflict. Indeed, like Woody Allen's Zelig, the flame-haired teacher manages to be around at every important historic event that has touched Hancock's own long life: the Festival of Britain, Ban the Bomb rallies, Thatcherism, the infamous women's liberation protest at the Miss World contest, the battle for gay rights and the advent of Aids.

With honesty and humanity, Hancock, a pacifist, creates a compelling portrait of education in post-war Britain and has dedicated the book to her own teachers - some of whom, such as the redoubtable Miss Fryer, "a fine woman and, ironically, a Quaker", and the unkempt, wispy-haired music teacher Miss Tudor Craig, are characters in the book, which Hancock admits was a mammoth undertaking.

"The publishers wanted me to write another book after the success of the other two. They suggested a novel. I said, 'No way. I'm not educated. I didn't go to university - which is always my thing - I can't do it. I'm not a literary person.' But about a week later I had an idea for a story about an old woman. It sort of came from seeing that woman, wearing lipstick, a splendid cloak and sporting a lorgnette, in Fortnum & Mason's, and how everybody ignored her. I began wondering what her life was like.

"She was so interesting to look at, something must have been of interest in her past. She seemed to be staring at me but ignored me when I acknowledged her - I think I was feeling a bit lonely that day, too. I began making notes, thinking how I might play her one day, noting down details. She didn't smash the sugar bowl but she grandly walked out; then, slowly, she sagged into nothing.

"Somehow that character evolved into a teacher. I wanted to get away from acting, from endlessly writing about myself. I wrote one chapter but I'd got it wrong. I was going too fast, so I started again, literally learning how to write fiction as I went along. I've read lots of wonderful novels and, of course, that's what put me off. I so venerate other writers."

Slowly, the book morphed into a social history. "I had to do all the research. which I fell in love with." She read dozens of non-fiction books and poetry collections, haunted the London Library, visited the Imperial War Museum, pored over newspaper reports and diaries, then travelled around the Vaucluse area of France, where Marguerite served with the SOE, visiting landing stations. (Hancock divides her time between homes in London and France.)

"Actually, I abandoned the book several times," she says. "I felt I wasn't up to it, but the publishers gave me an advance and wouldn't take it back. They kept saying I could do it, but it's been a long, arduous process for four years. Now, I'm terrified. People are going to read it! I think I said that to you about my other books but this is really scary."

The funny thing is, she continues, authors often say how characters take on a life. "I always thought, 'How bulls****y!' But it's true. One storyline kept coming to me through a character, who is a Bomber Command pilot. My first husband [the actor Alec Ross, who also died from cancer] was in Bomber Command. The war destroyed Alec, totally. So what I've tried to show through the theme of education is that the children of the children of all those men who were destroyed are still affected by the instability they suffered. I was a wartime child, of course, but Marguerite is not me, although we share a crazy idealism, a blind optimism about politics. Yes, a Messiah complex.

"What I hope is that people will read the novel and think how, if you get children early, you really can change lives. I worry about the way we treat children now. I do a lot of work with kids. I see so many dropping by the wayside. It makes me really angry - we could have got rid of private schools under the Attlee government in 1945, but he refused; he'd been to a private school himself. Now, we have an underclass that's forgotten. Too many children are being left behind in our society. It makes me furious."

Between them, she and Thaw had three children, all actors - Joanna from their marriage, Melanie from her marriage to Alec Ross and Abigail from Thaw's first marriage to Sally Alexander. Now Hancock has eight grandchildren aged from four to 19 whom she adores.

She based The Two Of Us on her diaries. She's since had a bonfire of the vanities, burning every one lest they lead to distress and conflict after her death. She's also told her daughters that should she start losing her marbles, she's to be admitted to a dementia ward. She doesn't want them to visit. "I don't want them to suffer. I'll be out of it anyway. Why should they remember me like that? At my age, you worry about dementia. I occasionally blank on a word and I think, 'Oh s***, that's the start.' It hangs over your head when you're in your 80s.

"Maybe that's why I began thinking of a novel about an old woman - and in the end it turned out to be exactly that, despite Marguerite's adventures. That day she sits in the cafe she realises how alone she's become, but she does something about it. We must not, however, give away the ending," warns Hancock, giving me a goodbye hug. "Let me tell you something," she says as we part. "You have to be a fighter. Be a fighter like me. God knows, it's an effort sometimes, but we all have a duty to keep waging that war for our children." n

Miss Carter's War by Sheila Hancock is published by Bloomsbury, priced £12.99. The author will be discussing her novel at Aboyne Community Theatre on October 20 and at Tait Hall, Kelso, on October 21.