Hello.
To get a ogg vorbis example was difficult but i finely go an example working.
the example is test.c. The exact location is libvorbis-1.3.3/ test/ test.c .
The other example was so buggy i gave up on it.
I did it on linux system at the consul. I compiled with this line:

gcc test.c -lvorbis -lvorbisenc -lvorbisfile -o test


And had to add these includes:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#include "util.h"
#include "util.c"
#include "write_read.h"
#include "write_read.c"

and remove the line 66 which is " remove (filename);"
This program will give a good working example on the encoder.

I have another example I made my self and will post it if asked.
It generates two differnt pcm sine waves in memory then encodes it
and save it to the hard drive. The ogg file will play a 200hz wave out of left head phone
and 1000hz out the other.
And now i am working on third example to take a saved wav file on hard drive and on convert
it to ogg file and save it on the hard drive.