With its 5000km long coast, Madagascar offers a large variety of seaside activity. No matter what kind of trip you are doing in the island, it is always possible to end it with few days or even few weeks on the seaside as you can move to different places. Same, it is also possible to cut the trip with few days on the beach before continuing with more discovery.
The most well-known places are Ifaty/Anakao near Toliary, Fort Dauphin in the deep South East, Nosy Be and Sainte Marie island.
Whale-watching period is between mid-july to end of September in general. The most popular and well-known places for that is Sainte Marie island but whales can be seen all around Madagascar during the same period and you can easily find local operators in places like Ifaty, Anako, Nosy Be, Fort Dauphin, Belo/Mer, … who are renting boat for going out to see them.