This research focuses on one of the most fundamental issues that defines the architecture of Cyber Physical Systems (CPS) - heterogeneity. Unlike the Internet where heterogeneity is normally addressed for the sake of functional interoperability, CPS systems are normally regarded as special-purpose systems of systems, designed mostly for critical infrastructures that require global regulation and performance assurance. Therefore, heterogeneity must be addressed not only for the sake of functional interoperability, but also for policy regulation and performance assurance. To address functional interoperability, a distributed framework, called the CPS-Bus, is proposed to flexibly interconnect different CPS subsystems. To support policy regulation, a policy specification language is developed to regulate the relationship between context, operation and rules. To achieve performance assurance over heterogeneous subsystems, a novel run-time combination of reflective interfaces and a distributed control framework is invented to address evolving performance dynamics and required on-demand functional (compositional) changes. This work will allow the effective interconnection of computation and physical processes to reveal the useful correlations among different phenomena and to conduct effective control across the boundary of CPS subsystems. For developers, this work will significantly reduce the design and development costs for building CPS systems. For end users, the resultant CPS systems will lead to exciting applications such as assisted living that will fundamentally improve the quality of every-day life.