This study aims at developing a generic, feasible and low cost occupancy detection solution to provide reliable real-time occupancy information in buildings. Currently, various low cost or even free occupancy measurements are common in offices along with the popularization of information technologies. An information fusion method is proposed to integrate multiple occupancy measurements for reliable real-time occupancy information using the Bayesian belief network (BBN) algorithm. Based on this method, two types of virtual occupancy sensor are developed at room-level and working zone-level respectively. The room level virtual occupancy sensors are composed of physical occupancy sensors, chair sensor, keyboard and mouse amongst others. The working zone-level virtual occupancy sensors are developed based on real-time GPS location and Wi-Fi connection from smart device like smart phones and occupancy access information from building management systems. The developments of these two types of virtual occupancy sensors can be conducted automatically with functions of self-learning, self-performance assessment and fault detection. The performances of the developed virtual sensors are evaluated in two private office rooms. Results show that the developed virtual occupancy sensor are reliable and effective in providing real-time occupancy information. The paper also discusses application of the virtual occupancy sensors for demand driven HVAC operations.