Time-Dependent Variational Principle for the Expectation Value of an Observable: Mean-Field Applications