This paper presents a new optimization framework to optimize the bidding strategy of a smart distribution company (SDC) in a day-ahead (DA) energy market. This SDC contains wind farms as stochastic DG units as well as plug-in electric vehicles (PEVs) as responsive loads. The intermittent nature of wind power may result in significant imbalance penalty costs for the SDC participated in the DA energy market. The proposed optimization framework uses the potential of plug-in electric vehicles (PEVs) and battery energy storage (BES) to manage possible imbalances of wind farms. In order to modify the charging pattern of PEVs, hourly electricity prices are calculated in the optimization framework and sent to PEV owners via smart communication system. PEV owners change their charging pattern in response to these hourly prices with the aim of reducing their electricity bills. In addition to responsive loads, BES and wind farms, the SDC also contains dispatchable distributed generators (DGs), distribution network and non-responsive loads. The two-point estimate method (TPEM) is used to model the uncertainties associated with wind farms power generation. Moreover, Benders decomposition technique (BDT) is implemented to simplify the optimization procedure. Finally, the effectiveness of the proposed framework is evaluated on several case studies.