Coupling of microscopic and macroscopic traffic models at boundaries