Tourists can get a visa on arrival from most nations for 30 days or 60 days, for about $45 USD or $60 USD paid at the counter before immigration and baggage claim. 90 day visas are not available anymore.
Immigration typically searches for problems to either punish or parlay bribes unfortunately, so do NOT arrive with less than 4, and definitely not less than 2, additional empty passport pages, or you may be literally (and we have seen this happen) ordered to buy a ticket out the same day without leaving the airport.
Also, the airport check-in in Tana is far more difficult than Nosy Be, which is a much more friendly entry point. Ivato TNR intentionally keeps the airport stressful, and they will search for problems with your baggage, your destination and transit countries, and visas and such to try to create problems for you. Be relaxed and prepared, and know your baggage limits and the IATA and immigration rules, so you cannot be fooled or squeezed.
Flying domestically is a little bit easier and there are a limited amount of domestic airlines, just Tsara dia, Air Madagascar, and Madagasikara Airways. Delays and cancellations are very common and customer service is notoriously bad, with no chance for fair refunds and very laborious booking channels.