When director Terence Young cast Sean Connery as James Bond in Dr No, Ian Fleming was none too pleased, having visualised his spy as more of a Cary Grant or David Niven type.

Aside from demonstrating his ignorance about the work of actors (Grant had famously transformed himself from a working-class Bristol boy to the epitome of high-class society), Fleming was clearly a snob.

This story, along with the work that Young did to turn Connery into a "gentleman", were the seeds for the Kingsman project in the minds of filmmaker Matthew Vaughn and Glasgow graphic novelist Mark Millar. The result shouldn't be seen as a rival to Bond, but a comic riff fuelled by a little social comment, which works a treat until comic book ultra-violence goes and messes it up.

Vaughn has already adapted Millar's subversive superhero fantasy Kick-Ass; this time Millar wrote Kingsman knowing the director was waiting in the wings. They've posited an independent secret service, free of government control, involving itself in global crises when it sees fit. The Kingsmen are bonded by class - generations of bluebloods who model themselves on the Round Table and whose secret lair is accessed by a Saville Row tailor shop.

"The suit is the gentleman's armour," declares well-tailored Harry Hart (Colin Firth), codename Galahad, as he introduces potential new recruit Eggsy (Taron Egerton) to the operation. The Kingsmen only hire when one of their number dies, at which point all of the agents can make a nomination. Harry's is the son of a former colleague who died saving his life. Therefore he has an emotional tie to the South London teenager, but also a political one; much to the annoyance of his boss, Arthur (Michael Caine), Harry is once again pitching a member of the working class.

The most pleasurable phase of the film is the set-up, as Vaughn puts his pieces in play: Firth's delicious articulation of the vocation of the bespoke-suited spy, demonstrating his skill set with a casual dismantling of Eggsy's sink estate tormentors; the tension between Eggsy and his public school rivals; and the introduction of the villain of the piece, Samuel Jackson's Valentine, an entrepreneur with a novel solution to global warming.

Firth is inspired casting. The Brit isn't a newcomer to the spy world, for he was an integral part of Tinker, Tailor, Soldier, Spy, but that was a talky spy thriller and he's never been an action hero. So, like Liam Neeson, he's getting physical in his fifties, which brings the piquancy of surprise to his lethal killer. Jackson gives Valentine a comic lisp and cheery disposition that add off-kilter menace to his egomaniac, and Mark Strong is a very likeable presence as Merlin, the Kingsman trainer.

There are also some well-handled action scenes and cute genre in-joking, notably during a verbal joust between Harry and Valentine; incidentally, Tarantino fans will note that their McDonald's supper tips its hat to Jackson's breakthrough role in Pulp Fiction.

And yet the film slowly unravels. Having a graphic novel as source material invariably leads to a darker film, which is fine, and a bloody one, which usually isn't. As Valentine's plan kicks into overdrive, it's accompanied by scenes of slaughter that, however impressively choreographed, leave a bad taste in the mouth.

One might argue that Vaughn is providing something similar to the new-era Bond films, which is a grittier acknowledgement of what violence means. But he's trying to have his cake and eat it - to be real, and still gleeful. And that leaves one shaken, not stirred.