Your cruise in May will be considerably cooler than ours in mid-summer last year. So, yes--layers are key.
We took the Treasures of the Rhine last year and enjoyed it thoroughly. Viking is not too formal. Your husband does not need a suit, though a sport jacket and slacks would be appropriate for the two "captain's events" during the week. (My husband has a couple of travel sport jackets from Travelsmith that serve well--he wears them while traveling to save suitcase space and for any jacket-suggested events we may attend.) You would not be out of place on the two dressier evenings on the cruise in a dress and heels, but that's not necessary. You will be fine in a dressy (not formal) pant outfit and flats.
Blue jeans? It's your choice. I wouldn't suggest jeans for dinner, though. I didn't take denim--mostly because of its bulk and weight. But it might feel good in Germany in May.
Hope this helps.