The OB associations of 30 Doradus in the Large Magellanic Cloud. II - Stellar content and initial mass function