Sample code to test:
Private Sub CalculateEndDateV2()
Dim Occurrences As Integer = 22
Dim Pattern As Frequency = Frequency.Yearly
Dim Interval As Integer = 5
Dim StartDate As Date = Date.Now
Dim startPosition As DayPosition = DayPosition.Third
Dim startDay As CalendarDay = CalendarDay.Thursday
Dim startMonth As CalendarMonth = CalendarMonth.March
Dim recurrencePattern As RecurrencePattern = New YearlyRecurrencePattern() With {
.Interval = Interval, .Occurs = Occurrences,
.StartDay = startDay, .StartPosition = startPosition, .StartMonth = startMonth
}
Dim ruleStr As String = String.Format("DTSTART:{0}{1}RRULE:{2}", StartDate.ToString("yyyyMMddT000000"), Environment.NewLine, recurrencePattern)
Dim calendarRecurrence As CalendarRecurrence = CalendarRecurrence.FromiCalendar(ruleStr)
Dim EndDate As Date = calendarRecurrence.GenerateOccurrences.LastOrDefault
End Sub