You'll have to loop through each feature in the feature class to get a polyline instead of trying to cast the entire featurelayer to a polyline.
*To answer your comment, it would look something like this. You'll have to translate into C#
Dim pFCur As IFeatureCursor
Dim pFeat As IFeature
pFCur = pfc.Search(Nothing, False)
pFeat = pFCur.NextFeature
Do Until pFeat Is Nothing
Dim pPolyline As IPolyline
pPolyline = pFeat.ShapeCopy
'your code to construct the offset
pFeat = pFCur.NextFeature
Loop