In AS Byatt's latest novel, The Children's Book, the author begins her story with a strange boy found in the basement of the Kensington - soon to be the Victoria and Albert - Museum. The Pitt Rivers Museum in Oxford features in The Subtle Knife by Philip Pullman and The House in Norham Gardens by Penelope Lively, while PD James created a museum - the Dupayne - for The Murder Room. There are many more examples.

Now it's the turn of the Foundling Museum. The London museum inspired former children's laureate Jacqueline Wilson to create Hetty Feather. Published last month, the book starts in 1876 and tells the story of its eponymous heroine, a baby given up to the Foundling Hospital by her desperate mother.

The museum occupies the premises where philanthropist Thomas Coram set up the Foundling Hospital in 1739 as a home for orphans and abandoned children. It asked Wilson to become its Coram Fellow in 2007.

Having created Tracy Beaker, a young girl living in care at the "Dumping Ground", Wilson was a natural choice for a Coram Fellow. Her Beaker books had made the author an obvious focal point for campaigning for child safety and, as laureate between 2005-07, she was active in children's literacy campaigns.

For Wilson, one of the appeals of the Foundling Museum is the emotive objects it holds. "My favourite objects in the museum are the little tokens that mothers left in the 18th century: tears always spring to my eyes when I see them," she says.

"But tokens weren't left in the late-19th century as far as I know, so they didn't really influence my book. I found the pictures of Victorian foundlings very useful, especially the ones of the girls eating in the dining room. The grand stairs in the museum are the actual ones from the hospital, and every time I stand on them I imagine my Hetty running up and down them."

Expert help

The museum's staff played an active role in helping Wilson shape her story. "I told them what I wanted to do and they were very encouraging," she says. "I attended an education day where the staff did a brilliant job of telling very lively children all about the Foundling Hospital. It was very helpful for me to see real children dressed up in authentic foundling uniform.

"When I'd written Hetty Feather, I sent it to Annette McCartney, the learning and access manager at the Foundling Museum, and she very kindly read it through and corrected a few details."

Strictly speaking, Wilson was not a writer-in-residence at the museum, although others have gone down this route. In 1997 the Arts Council England (ACE) drew up a series of guidelines for writers and institutions considering setting up residencies.

ACE's guide (last updated in 2003) stresses that a residency is a project that needs a clear brief to succeed. It is crucial that the objectives, budget and the timeline of the residency are established from the beginning, as well as methods of evaluating the project once it's over.

The best relationships between writers and museums are mutually beneficial. The museum gets a writer who, via their creative work, produces their own slant on the institution's collection; and the writer has the benefit of a close working relationship with the museum's experts and the additional fillip of a whole new audience to reach.

The Roald Dahl Museum and Story Centre in Great Missenden, Buckinghamshire, is among those museums that have used writers-in-residence, although before it could appoint anyone it had to work out where its writer was going to live.

"We originally offered a flat with the job, but this proved a nightmare as it counts as a benefit in kind for tax purposes," says the museum's director, Amelia Foster. Instead, it was decided that the writer should become a part-time member of staff, with the same terms and conditions of contract as full-timers.

Mutual benefits

The Roald Dahl Museum has had two writers in residence - Val Rutt, the first, was followed by Adam Guillain. Foster says it's been a "great experience", one that has helped the museum to use its limited resources to get out to local schools and other premises, including the young offenders' institute in Aylesbury and women's refuges.

At London's Science Museum, a residency led to a small book. Writer Tony White imagined the discovery of a secret device, the "listening post", among the museum's collection. His resulting sci-fi story, Albertopolis Disparu, was published in 2008 as a limited-edition book, which can be downloaded.

White's residency was part of the Science Museum's continuing engagement with artists, says Hannah Redler, its head of arts projects. While the museum had previously worked with poets such as Michael Rosen, Lavinia Greenlaw, Selima Hill and Matt Harvey, this was its first foray into fiction.

White says he saw the residency as "a means to reflect on the kinds of stories that the Science Museum tells the world about itself, about its collections, and about projects like Listening Post" - a digital work of art by Mark Hansen and Ben Rubin installed in the museum. While in residence, White organised workshops and used the museum's resources to help situate his story.

"Overall, the project was a success for our arts projects," says Redler. "Our goal is to engage with science and technology, but firmly from the perspective of artists investigating the world around them. This project established new means of thinking about science as a cultural activity, created a community of writers with similar interests and offered the public a free and unusual opportunity."

Narrative adventures

But it's not just writers-in residence that can get the creative juices flowing. Since 2006, National Museums Scotland (NMS) has employed resident storytellers (funded by grants from the Scottish Arts Council) to conduct workshops and projects at the National Museum of Scotland, National Museum of Rural Life, National War Museum and, more recently, the National Museum of Costume.

This led to a Story of the Month being posted regularly on the NMS website, a strategy which allowed even greater participation. "These storytelling projects have allowed NMS to engage with its visitors by bringing museum objects to life," says NMS spokeswoman Kerryn Fraser.

"By researching and presenting the stories behind the objects on display, and encouraging visitors to compare life today with the experiences of people in the past, storytellers have presented new ways of looking at history and deepened visitors' understandings of the national collections."

The impetus to find new ways of presenting and interpreting collections has also inspired Evolving Words, a poetry and performance project that is part of Darwin200, a year-long celebration of the naturalist's birth in 1809.

Aimed at reaching an audience aged 14-25 and enthusing them with all things natural selection, Evolving Words's partners include the National Library of Scotland, the Centre for Life in Newcastle, World Museum Liverpool, the Manchester Literature Festival and Manchester Museum.

As part of Evolving Words, musician Soweto Kinch will perform a piece inspired by Darwin's science at the Wellcome Institute in London on 19 November. Kinch is one of a number of performers and poets who have been involved in the project and have worked closely with museums, libraries and universities.

Whether it's with novelists, writers-in-residence or storytellers, it's worth museums nurturing good relationships. Jacqueline Wilson intends to continue her work with the Foundling Museum and the associated Coram Society, which helps "modern Hettys who need extra care and loving support".

The Foundling Museum held a special Hetty Feather day last month to launch the book and Wilson spoke at the opening of the museum's In the Picture (30 July-27 September), an exhibition focusing on the representation of disabled children in children's literature.

Wilson declares her feelings about the museum quite openly: "I love the Foundling Museum and all the friendly helpful staff." Which is about the best endorsement a writer could give a museum.

Louise Gray is a freelance writer.

The Science Museum has donated ten copies of Tony White's Albertopolis Disparu to Museums Journal. The first ten entries out of our hat each gets one. Write to journal@museums association.org and title your email "Albertopolis"

Brought to book: museums in literature

"Please take us to Guildford Street," said Mother, fingering her fat purse to show she could pay the fare.

"The Foundling Hospital?" said the cab driver. He sucked his teeth and shook his head at us. "Poor little mites."

We clambered inside his cab and peered out in awe and terror at the crowded London streets. […]

My heart thudded whenever I spotted any great grey building in case it was the hospital. At last the cab slowed and came to a stop outside great iron gates enclosing a plain wide building with many arched windows. Mother drew in her breath and clutched our hands tight. She didn't need to tell us. We were at the Foundling Hospital."

© Jacqueline Wilson, 2009. Hetty Feather is published by Doubleday, £12.99

"'Machine' is perhaps too small a word to describe the complex enterprise I saw stretched out before my eyes [in the tunnels beneath the Science Museum and Imperial Institute]. It was a vast network of generators, telegraphic exchanges and switchboards, difference engines, teleprinters, ticker-tape machines and phonographs, with every steam engine and turbine in the building all being connected and 'daisy-chained' together by means of a series of camshafts and belts that disappeared off in every direction, through ceiling and floor, and all were going 'full tilt' to provide enough power to run it."

© Tony White, 2009, Albertopolis Disparu. To download the story, visit sciencemuseum.org.uk/writer