This paper has described many issues in the implementation of a flight simulator. This paper discussed implementation issues for a minimal, but complete, flight simulator.
The basic principle of flight simulation is this: determine a basic set of state variables that completely define the state of the airplane, and calculate their time derivatives based on the control input. Then, using these time derivatives with a finite difference method, calculate the state a small amount of time in the future. Base the output on the current state.
A flight simulator has quite a lot of room to grow beyond what this paper described. The simulator can take on tasks not discussed here, such as ATC communications, crash detection, failure modeling, control system modeling, aeroelastic modeling, more advanced input and output, communication with other flight simulators, simulating more than one airplane at the same time, and many more.