There are 2 basic ways of getting worms/bugs out of/in old books. The poor man's way and the one who has a large budget.
Let's mention the one for most of us poor folks. It's quite simple and cheap! Take the book, wrap it in about 2 to 3 plastic bags tightly, and put it in the freezer for about 3 days. After 3 days, remove the book from the freezer, remove the plastic bags and let it air out for another few days, taking care to leaf through the pages to get rid of any moisture which if not done can cause mildew to start in the book. If you leaf through the pages, you may see the worms, and if you touch them, they should be "melted", sort of gooey. They are 100% dead! Take my word for it! Let the books air out for a couple days so that there's no moisture. DON'T just put the book back on the shelf, as moisture will build up and ruin the book and those next to it of left for a long period of time.
The other, more expensive way is to fumigate the book in a University library which offers this kind of service, a usually expensive one may I add. They use gas to remove the oxygen and snuffing all life not indigenous to the book.
I would shun away from spraying the book as the moisture from the spray may cause discoloration and start mildew if the book is not dried out properly.Please vote on this guide, it really is appreciated!