Anime is not definately slumping in Japan. Currently, there are about 80 programs shown each week in Japan. The most watched animes in Japan are Detective Conan and One Piece. Those two anime steal the ratings every week/month.
There is however a situation in Japan. There is an overflow of anime at the moment and sponsors are becoming scarce. It's this reason that anime get licensed and fansubbing stops for the affected anime for e.g. Hikaru no Go, Wolf's Rain, Stand Alone Complex etc. Anime is starting to attract the mid 20s to mid 30s now in Japan. Heaps of projects are started every year. Actually regarding the manga question of yours, most anime wouldn't exist without them. Most animes start off as manga's or games or even hentai games. Yes, you read correct - hentai games. All it takes is for someone from a anime production company to like a manga or even the idea of a manga and if negotiations go correctly, bang, you get your anime.
As for hentai games turning into anime, often they are toned down to fit the audience. They are often really popular too. Hentai games (or also known as adult dating simulators) are famous for really engrossing storylines with countless plot twists and shocking revelations. H-games are a popular choice for producers because of the potential they have i.e. the good story. With an already good story, a bulk of the work is already done.
Hentai games are obviously for the male audience and so, it's a challenge to somehow transform it into something for the female audience as well. Shingetsutan Tsukihme (Lunar Legend Tsukihime) and Kimi ga Nozumu Eien were h-games and proved popular animes. Though unlike Tsukihime, KGNE had sex scenes. Japan are rather lenient about pervertnedness being shown on television.
After the anime has finished or even during the anime is still running, there is further marketing done. I'm talkin' games, OSTs, artbooks etc. Some animes have heaps of OSTs accompanying them. There are even such things as Drama CDs where the there's just mostly talk by characters of the anime and also comments left by the voice actors. Anime reaps in money every day, week, month, year, decade...go figure. Speaking of OSTs, anime also helps singers/groups and bands break out into the music industry. Over the past year or so, I've seen heaps of artists emerge because of anime. Oh yeah, let's not forget the action figurines.
If it's one thing that's hurting the anime industry, it's the horrendous dubs that accompany them. Just in my preference, I don't care how good the dub is (even if Hollywood actors did the voice overs) nothing beats the original. The Japanese dialogue is almost impossible to re-create into english.