Select total number of records from common table expression
No, because you can't mix assignments and result set generation

But what you can do is make the total row count into an extra column

WITH Results AS
(
    select
        ---,
        COUNT(*) OVER () AS TotalRowCount -- this
    ...
)
SELECT
   *
FROM 
   Results 
WHERE 
   Results.RowNum BETWEEN @StartIndex + 1 AND @StartIndex + @MaxCount