This can be formulated and solved as a Quadratic Programming (QP) problem, by minimizing -trace($X^TSX)$ subject to the element-wise bounds $0 \le X \le 1$. If the objective is not convex, then a global (non-convex) QP solver, such as CPLEX, can be used to find the globally optimal solution.
Using YALMIP under MATLAB, and presuming a global QP solver is installed (convex QP solver is sufficient if the objective is convex), this can be formulated and solved with the YALMIP code (portion of line after % is comment):
X = sdpvar(n,k,'full'); declare an n by k matrix variable X
optimize(0 <= X < = 1,-trace(X'*S*X)) % minimize 2nd argument subject to constraints in 1st argument
disp(value(X)) % display optimal value of X (presuming solver reports problem has been solved