Multicomponent van der Waals equation of state: Applications in nuclear and hadronic physics