The inspiration for Sherlock Holmes was a professor that Sir Arthur Conan Doyle had in medical school, Dr. Joseph Bell. He does sound like a very inspiring guy, an interesting blowhard at least who actually lived up to his image of himself:
http://www.siracd.com/work_bell.shtml
http://en.wikipedia.org/wiki/Joseph_Bell
From one of the websites above, a lot of info about the author of Sherlock Holmes, who grew so tired of the character that he had him killed off. Interestingly, all that occurred prior to publication of the Hound Of The Baskervilles story, which is one of the most famous Holmes stories published.
http://www.siracd.com/Sherlock-Holmes.shtml
The theory of the inspiration for Professor Moriarty is that he was based on American criminal Adam Worth. Although an American, he fled to Europe and London where he founded an underground crime ring which seems to have left a huge impression on the British at the time.
http://www.siracd.com/sherlock/moriarty.shtml
Adam Worth's story is incredible; he had a very successful life of crime in the US before going to Europe, he had a three-way marriage with his best friend and a woman who later spurned both of them, he lived a high life in London financed by his crime ring, he was a "gentleman criminal" who commanded his employees to work without guns, or at least without killing others, after he became distraught over his friend being caught he set up a bad bank robbery that caused him to get caught and go to prison, and when he got out he visited his American pursuer in the Pinkertons to get his help returning the painting he had stolen, possibly in gratitude for not being extradited to the USA once he had been captured.
http://en.wikipedia.org/wiki/Adam_Worth
http://www.crimelibrary.com/gangsters_outlaws/cops_others/pinkerton/6.html
http://community.seattletimes.nwsource.com/archive/?date=19971005&slug=2564164