You can refer to http://www.cypress.com/documentation/code-examples/ce216892-usb-hid-trackpad for PSoC 4 trackpad.
To implement two-finger gestures, refer to section gestures tab in the component datasheet. You can also refer to the following APIs.
You can call CapSense_IncrementGestureTimeStamp() in a Systick callback function (that gets executed every 1 ms). Also set a flag in this function.
After scanning and processing of widgets are completed, call CapSense_DecodeWidgetGestures() to decode the detected gesture, only if the flag is set. This is to ensure that CapSense_IncrementGestureTimeStamp() is called prior to decoding the detected widget gestures.
You can refer to SysTick_Example, by navigating to PSoC Creator-> Code example, for the use of SysTick timer.
Thank you for your information about PSoC4S sample firmware.
does exist PSoC 6 sample firmware?
You can find a PSoC 6 gesture example here:
Although it uses a slider with one-finger gestures, the firmware flow is similar. See touch_task.c source file for details.