Oh, that I know completely, with the spin-off stuff being shown by a Japanese TV show last year.
Main series Pokémon games...all done by Game Freak. Director is Junichi Masuda and he, among the others at Game Freak, decide on the direction of the series. They can even countermand Nintendo's wishes. Do you really believe Nintendo wanted BW and B2W2 on the DS while the 3DS was imminent/a year old?
Spin-off games is a whole other situation. There are two ways this goes. First is the conventional way. A third party developer such as Koei Temco, Jupiter, Genius Sonority etc. come to them with an idea and this is discussed at The Pokémon Company in Japan, led by Tsunekazu Ishihara. The prototypes are discussed and things such as how to improve are put forth. We actually saw this process with Pokémon Battle Trozei last year. It's then moved on from there.
Alternatively, The Pokémon Company can come up with an idea and help in the development of that. This was seen with the upcoming 3DS title, Great Detective Pikachu, due for release next summer.