Both destinations are served by Chandigarh (IXC). Since there's no flight route between them, the best way to travel is by road.
Dharampur Himachal
Fly to Chandigarh (IXC), then travel by road to Dharampur Himachal. Taxis, buses, and private cabs are available from the airport.
Shimla
Fly to Chandigarh (IXC), then travel by road to Shimla. Local transport options include taxis, auto-rickshaws, and state buses.