The New York Times recently featured an article indicating that many publishers, especially those producing books for young readers, are coming up with related online games at the same time. One author, PJ Haarsma, said that this "brings the book into their world, as opposed to going the other way around." In other words, the game pretty much comes first.
Another example of the trend is the "The Maze of Bones," a ten-book mystery series connected to an online game. The publisher is Scholastic Books.
Marketing gimmick or the evolution of reading? It's not clear yet but one of the critics pointed out that one of the big differences between the two formats is that games tend to be interactive--what you do affects the action--whereas in reading the author is running the show. On the other hand, with books you have a lot of leeway as to how you imagine the characters and settings, while in games the visuals are presented to you.
I can imagine a child reading a book and then going online to play a game set in the same world, or vice versa, but as I've said before, I'm a bit skeptical about how well these two formats actually integrate. However, I have noticed how many big-budget, big-effects movies seem to be more like video games all the time, with a set of action sequences that could be presented in any order, rather than in a compelling story arc.
The other issue is that a games writer/creator is not necessarily a good book author and vice versa, so in most cases it would be up to the publisher to acquire the book or game and then commission the other format, or hire two people to work in concert.