If $M$ is ordinary - yes (ordinary in sense defined here - researchgate.net/publication/…). I guess you found that already, but that's my 2¢.
– Harun ŠiljakSep 4 '12 at 15:01

I guess the growth rate is all you could expect to say anything about.
– i. m. soloveichikSep 4 '12 at 15:14

Given n has prime factorization with exponents a,b,c..., M is (a+1)(b+1)((c+1)..., and the exponent bases are the first however many primes. You have an upper bound of 2^(M+1), which can be optimized quickly. If M itself has k prime factors, you get (p_k)(kf) as a quick upper bound, where p_k is the kth smallest prime and f is the largest of the k prime factors. However, even a greedy strategy may not yield the minimum, so you will still need to do some searching. Gerhard "Ask Me About System Design" Paseman, 2012.09.04
– Gerhard PasemanSep 4 '12 at 15:28

Do you insist that the number of divisors is exatly $M$ or is at least $M$ what you are interested in. If you care about exact count note that this then depends quite a bit on the $M$ and not just its rough sizes (and this is what the comments refer to). To highligth something implictly in other comments. If $M$ is prime for example, it is clear that the only eligible $N$ are (M-1)th prime powers, and then clearly one needs to take a power of two. If you care just about at least $M$ this is a different question; then a keyword is "Highly composite number".
– user9072Sep 4 '12 at 15:45