Wasn't aware of the issue raised by Vittorio. but the following code may help. It uses the IGraphbuilder2 FindPin to look explicitly for the Capture pin on a base filter.
CComPtr<IPin> GetCapturePin(ICaptureGraphBuilder2* pGraphBuilder, IBaseFilter* pFilter)
{
CComPtr<IPin> pPin;
HRESULT hr = pGraphBuilder->FindPin(pFilter, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,FALSE, 0, &pPin);
CHECK_HR(hr, _T("Unable to Create the FilterGraph"))
return pPin;
}