What I am wondering is what are the conditions for switching to a higher class. Is it necessary to go through all the ranks in each class?
There is no hard rule. Unlike maîtres de conférences, who need to reach the 7th rank of the normal class to be eligible to apply for the outstanding class, professors have no specific rank requirements for promotions.
However, there are discipline-specific criteria that are set by the relevant section of the "Conseil National des Universités" (CNU). It's a promotion, and it doesn't come for free. You need to write an "activity report" to support your application, which will then be evaluated and ranked among all the other applications for that year. Common criteria include research output, international standing, doctoral supervision experience, service to the university, etc. A quota is set each year for how many promotions there will be. Half are awarded by the CNU and half by the local universities.
Also, is it possible to become directly professor or should one become first "Maitre des conferences"?
It's theoretically possible. Since this is largely unrelated to your other question I'll let you ask another one if you want more information.