A medical device for examination or treatment based on a reference point, includes: a virtual endoscopic image generation section configured to generate a virtual endoscopic image of a bronchus from a plurality of different line-of-sight positions using three-dimensional image data of the bronchus of a subject that is obtained in advance an image retrieval section configured to retrieve a virtual endoscopic image highly similar to an endoscopic image of the bronchus picked up by an image pickup section arranged at a distal end portion of an insertion section a reference-point setting section configured to set a reference point based on a line-of-sight position of the highly similar virtual endoscopic image and a relative-position calculation section configured to calculate a relative position of a treatment instrument to the reference point.