We introduce a sensor for direct measurement of tip-sample interaction forces in probe microscopy. The sensor uses a micromachined membrane structure built on a transparent substrate with an integrated diffraction grating for optical interferometric detection, and a built-in electrostatic actuator. To demonstrate our concept for this sensor, we measured the force curves between an atomic force microscope (AFM) cantilever tip and a micromachined aluminum sensor membrane built on a quartz substrate. We also measured transient interaction forces exerted on the sensor membrane during each cycle of the vibrating AFM cantilever. These agree well with the temporal response of the sensor to a short force pulse applied by our integrated electrostatic actuator. With the addition of an integrated tip, this structure may be used for scanning probe microscopy with a bandwidth limited by the membrane dynamics.