In this dissertation, we investigate the generalized semiparametric varying-coefficient models for longitudinal data that can flexibly model three types of covariate effects: time-constant effects, time-varying effects, and covariate-varying effects, i.e., the covariateeffects that depend on other possibly time-dependent exposure variables.First, we consider the model that assumes the time-varying effects are unspecified functions of time while the covariate-varyingeffects are parametric functions of an exposure variable specified up to afinite number of unknown parameters. The estimation procedures are developed using multivariate local linear smoothing and generalized weighted least squares estimationtechniques. The asymptotic properties of the proposed estimators are established.The simulation studies show that the proposed methods have satisfactory finite sample performance. ACTG 244 clinical trial of HIV infected patients are applied toexamine the effects of antiretroviral treatment switching before and after HIV developing the 215-mutation. Our analysis shows benefit of treatment switching before developing the 215-mutation.The proposed methods are also applied to the STEP study with MITT cases showing that they have broad applications in medical research.