I thought Lewis was the inspiration for Treebeard - at least for his way of speaking.
Tolkien did say that the inspiration for Gandalf came from a painting by Josef Madlener - der Berggeist. Indeed, he kept the postcard he picked up of it in an envelope with 'Origin of Gandalf' written on it. The painting & some background info is here:
http://www.houghtonmifflinbooks.com/..._7insert.shtml