The unit cards need to have the same name as a unit variant file, minus the "soldier"/"officer"/"unit_variant" bits, to be associated with it.
Example time!
The unit card file name for the Yari Ashigaru unit is "ashigaru_inf_yari_ashigaru.tga". There are usually multiple unit variant files for a single unit spanning officers, soldiers and standard bearers. The important unit variant file is that of the soldier ("ashigaru_inf_yari_ashigaru.soldier.unit_variant"). If you use that unit variant, then you will need to make sure "ashigaru_inf_yari_ashigaru.tga" is in your pack file.
An additional note: the file path for the unit cards is "Filenamehere.pack > ui > units". From there, you have five different types of icons that you'll want to create. I suggest creating the unit card for the "info" folder and editing it to make the other four cards, as they have a lower resolution than that "info" unit card. This is obviously for the sake of polishing. Oh, and you don't need to use "Filenamehere.pack". Use whatever file name you want.
Hopefully that conveys enough information that you can apply it to custom units.