You could always look at the canonical source: the actual Quake 2 source code: https://github.com/id-Software/Quake-2/blob/master/ref_gl/gl_mesh.c
I suggest that the drawing code would be a good place to start because that's the actual data that will be going into your vertex buffer. Also look at the loading code here: https://github.com/id-Software/Quake-2/blob/master/ref_gl/gl_model.c#L929 but that's incredibly simple and API-neutral.
MD2 files use keyframe animation so what you would do is load the model into two vertex buffers, one containing position/normal for all keyframes and one containing texcoords. Also load an index buffer. Then when drawing bind the first buffer to two slots, offsetting for current and previous frames, and do the keyframe interpolation in your vertex shader.
The only tricky part is getting the vertex and index counts before creating your buffers, and I'd suggest doing a pass through the model, similar to the drawing loop but accumulating the counts, as perhaps the simplest way.