Methods for producing microneedles