Modernization of electric grids worldwide continues in earnest, with increasing deployments of renewable and distributed energy resources (DERs); flexible loads with evolving usage patterns; and new control solutions in distribution networks. The convergence of these new technologies inherently increases the complexity of the power system; and maintaining safe, reliable, and efficient operation of modern grids relies on the successful integration of these many technologies together. Achieving successful modern grid control solutions requires not only the development of innovative distributed coordination techniques, but also methods to effectively and accurately test such complex solutions prior to field deployment and approaches to achieve cost-effective, high-bandwidth, inference capabilities in buildings and distribution grids. In the first part of this thesis, we make important contributions to the design of power hardware-in-the-loop (PHIL) simulations, an important tool for derisking modern grid technologies in a controlled laboratory setting. This technique allows actual at-power devices and systems to be interconnected in software simulations of complex, large-scale power system scenarios to evaluate their closed-loop interaction. We develop a novel approach to designing PHIL simulation interfaces that maximizes simulation bandwidth and accuracy by leveraging a modern control framework that explicitly considers objectives on accuracy and can automatically synthesize a single, optimal controller that meets these objectives while stabilizing the closed-loop system. This method improves upon common approaches to PHIL interface design that typically involve multiple steps of manual compensation and stabilization design that can result in interfaces that are stable but have suboptimal bandwidth and accuracy. The approach developed is general and can be applied to most PHIL system configurations. We also present a practical method and metrics for verifying the true accuracy of PHIL simulation results without relying on relative comparisons to potentially inaccurate models or previous simulation results. We demonstrate the accuracy evaluation method and show the improved performance achievable when using the optimal PHIL interface design approach in an experimental case study involving a 100-kVA battery inverter. The second part of this thesis develops a novel approach for high-frequency, multi-class nonintrusive load monitoring (NILM) that enables effective net-load monitoring capabilities with minimal additional equipment and cost. Relative to existing NILM work, the proposed solution operates at a faster timescale, providing accurate multiclass state predictions for each 60-Hz ac cycle without relying on event-detection techniques. We also introduce an innovative hybrid classification-regression method that allows for the prediction of not only load on/off states via classification but also their individual operating power levels via regression. The overall approach is validated using a test bed with eight residential appliances and is shown to have high accuracy, good scaling and generalization properties, and sufficient response time to support building grid-interactive control at fast timescales relevant to the provision of grid frequency support services. The third part of this thesis develops and experimentally demonstrates a first-of-its-kind hierarchical control solution for optimally dispatching thousands of deferrable loads and DERs across a distribution feeder to provide fast frequency response (FFR) within 500 ms to the bulk power system. This approach rapidly coordinates resources online after a frequency event occurs, allowing fast-changing, behind-the-meter resources to be incorporated and aggregate FFR power set points to be achieved more quickly and accurately than existing approaches. We also present a solution for determining the optimal amount of headroom to operate solar inverters with to minimize opportunity cost while ensuring the FFR response viability of a building with the inverter and deferrable loads. We develop practical algorithms for fast, cost-based optimal dispatch at multiple aggregation scales, establish their optimality, and demonstrate via simulation that they are faster than state-of-the-art, coordinated frequency response approaches. The entire control platform developed is implemented and experimentally verified using a unique PHIL demonstration, including more than 100 powered loads and DERs connected to a real-world distribution network model. Experimental results from multiple scenarios confirm that the optimal FFR dispatch approach scales well and can optimally coordinate more than 10,000 net-load resources across a distribution network while achieving hardware response times within 500 ms, which is not possible using existing optimal coordination approaches.