Gilbert Adair wrote The Holy Innocents a few years ago (which I haven't read). When Bertolucci wanted to film it, Adair wrote the screenplay and rewrote the novel as The Dreamers, although in an epilogue he explains that the book and film are deliberately different. It’s a quick read (borderline novella), but twisted and interesting.
The story is set in Paris in the riots of May 68 and concerns a young American student who befriends twins at an arthouse cinema they regularly attend. A knowledge of classic cinema helps, but the films and riots are really just a backdrop to a tale of game playing, manipulation, obsessive relationships, triangular relationships, confused sexuality and crossing boundaries. Parts of it are beautifully written and parts embarrassingly banal. The book is less ambiguous than the film and has a very different ending, though I'm not sure which I prefer.