Trigonometry!
Use the mousemovex() and mousemovey() to change two angle variables, then use trigonometry to calculate a camera position in 3D space and point the camera towards 0,0,0.
You could simplify it by restricting the movement to effectively 2D circular motion by the mousex, and then allowing the mousey to only change the height of the camera.
And, because I'm a nice guy, here's some code I made a while ago:
dim ACam#(2)
dim PCam#(3)
dim Temp#(2)
do
ACam#(1)=wrapvalue(ACam#(1)+(mousemovey()*0.2))
ACam#(2)=wrapvalue(ACam#(2)+(mousemovex()*0.2))
if ACam#(1)>40 AND ACam#(1)<180 then ACam#(1)=40
if ACam#(1)<320 AND ACam#(1)>180 then ACam#(1)=320
PCam#(2)=40*sin(ACam#(1))
Temp#(1)=sqrt(800-(PCam#(2)^2))
PCam#(1)=Temp#(1)*sin(ACam#(2))
PCam#(3)=Temp#(1)*cos(ACam#(2))
position camera PCam#(1),PCam#(2),PCam#(3)
point camera 0,0,0
sync
loop
This won't work if you just copy/paste it, I'm afraid, as I've just ripped the important bits straight out of a little app type thing I made.
"I am a living, thinking entity who was created in the sea of information."