There are mutations in at least five human genes (sometimes more than one such mutation per gene) that have been selected for because they provide resistance to malaria (
HBB,
SLC4A1,
FY,
G6PD and
CD40L). Selection for resistance to other diseases is also likely, and is under investigation (e.g. a mutation in
LARGE, which has been hypothesized to give resistance to Lassa Fever).
None of these cases involve the immune system. There undoubtedly has been pathogen-driven selection in immune-related genes, but it is difficult to tease out exactly what has been selected for, and why. In particular, selection has clearly occurred throughout the HLA region on chromosome 6, which contains a cluster of immune-related genes. Genetic variation is much higher there than elsewhere in the genome, and there is also evidence for recent incidents of selection for particular variants.