Actually, in the books Moriarty was featured in only two stories. He was first introduced in "The Final Problem" in 1893, and even Watson had never heard of Moriarty before. Holmes and Moriarty dueled at Reichenbach Falls, and Holmes was presumed dead for years. When Holmes comes back, the villain is a former henchman of Moriarty, but that's it.
The next story Moriarty was in wasn't published until 1917, and it was called "The Valley of Fear." But, and this is an example of Arthur Conan Doyle's wonky timelines, the case is set in 1887 or so, and for some reason Watson knows all about Moriarty as a criminal mastermind. Which sort of implies that Watson must have been lying about the other case. But those are really the only two cases Moriarty was in. He was not at all the last case of Holmes's. He was more like in the middle.
But as people said earlier, the movie itself is not actually based on a specific book, so it doesn't have to follow anything written. I loved the movie and can't wait for the sequel.