An optimal stochastic tracking scheme is proposed for an interactive smart grid infrastructure made of three steps: 1) The utility reshapes the customer load profiles by scheduling a demand response for the requested customer loads; 2) individual smart home makes optimal sequential decisions on power purchase; and 3) optimal stochastic control schemes for the active power balance (primary frequency control) are designed, in the presence of uncertainties arising from customer loads and distributed renewable generations. With the first two parts addressed in our previous work, in this paper, we focus on the primary frequency control scheme design in the multilayer control architecture to stabilize frequency and maintain the active power balance within the distributed areas. We propose two stochastic tracking schemes based on the state-space representation of a synchronous generator: 1) reference-dynamics-based tracking and 2) reference-statistics-based tracking. We further extend the proposed optimal controllers by considering the realistic scenario of asynchronous load signals from different customers. To compensate for different delays seen by different customer signals, a Kalman-filter-based prediction scheme is proposed to estimate the correct reference signal. We show that the centralized reference prediction can equivalently be implemented distributively. Simulation results are presented, showing the performances of the proposed prediction and tracking schemes.