Well, you'd use a query as a source for a pivottable so you'd use SQL view of that query.
As for manipulating the presentation of pivottable itself, yes, you'd use the Office Web Components to provide the OM for the PivotTable & associated objects. You can get intellisense support if you add a VBA reference to OFFOWC.DLL (located in the OfficeXX folder where XX = the version of your installation {14 = 2010; 12 = 2007; 11 = 2003 } ) though I recommend that you remove the reference when you're done with development so your users don't have problems running it on different version. If you're unfamiliar with concept of early binding/late binding read up on this first so you understand the effect of adding the reference.
Where is the code for my existing pivot table? You're right, there is a query and you can go into SQL view and look at the query. But it's just an ordinary query. And the form is just a form with textboxes on it.