It really depends on what you're using. Most microcontrollers don't require external memory to store their program because it's stored in on-chip flash memory. Additionally, you can generally order microcontrollers from a distributer that are already flashed with your program. Though this may require ordering 1000+ units. If that isn't an option then you'll have to ensure that the pins used for programming are exposed in some fashion and then you'll flash it. The exact details are dependent on exactly which microcontroller and toolchain you're using.
It mostly comes down to reading the documentation for the specific microcontroller that you're using.