The HLA (Human Leukocyte Antigen) genes and the KIR (Killer cell Immunoglobulin-like Receptor) genes are critical to immune responses and are associated with many immune-related diseases. Located in highly polymorphic regions, they are hard to be studied with traditional short-read alignment-based methods. Although modern long-read assemblers can often assemble these genes, using existing tools to annotate HLA and KIR genes in these assemblies remains a non-trivial task. Here, we describe Immuannot, a new computation tool to annotate the gene structures of HLA and KIR genes and to type the allele of each gene. Applying Immuannot to 56 regional and 212 whole-genome assemblies from previous studies, we annotated 9,931 HLA and KIR genes and found that almost half of these genes, 4,068, had novel sequences compared to the current Immuno Polymorphism Database (IPD). These novel gene sequences were represented by 2,664 distinct alleles, some of which contained non-synonymous variations resulting in 92 novel protein sequences. We demonstrated the complex haplotype structures at the two loci and reported the linkage between HLA/KIR haplotypes and gene alleles. We anticipate that Immuannot will speed up the discovery of new HLA/KIR alleles and enable the association of HLA/KIR haplotype structures with clinical outcomes in the future.