Programming bare microcontroller chips
You can use a JTAG programming tool for this purpose. Pinout of the programmer looks like this:



You can find matching pins on the IC:



When you design your custom board, you can put in a row of header pins connected to these pins. When your PCB is assembled, use spring loaded pins or a cable connector to program the board. Somewhat like this (image source):